# How do I pass data to an artifact?

**URL:** https://meta.discourse.org/t/how-do-i-pass-data-to-an-artifact/350791
**Category:** Feature
**Tags:** completed, ai, ai-artifacts
**Created:** [February 5, 2025, 7:15pm UTC](https://meta.discourse.org/t/how-do-i-pass-data-to-an-artifact/350791 "2025-02-05T19:15:07Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [February 6, 2025, 11:13am UTC](https://meta.discourse.org/t/how-do-i-pass-data-to-an-artifact/350791/3 "2025-02-06T11:13:51Z")

</div>

> [@sam](#):
>
> @david do you think there is any security implication to passing in information about the outside world to an artifact? (leave sandbox, but I guess echo `window.location.search` into some sort of attribute?

Giving the artefact access to the query string sounds ok. Easiest thing would be to use Ruby to inject it into the untrusted html document. Maybe as a meta tag or something.

> <https://github.com/discourse/discourse-ai/blob/cf86d274a02c45b4edbc9a7be3044a6c53e47661/app/controllers/discourse_ai/ai_bot/artifacts_controller.rb#L36C18-L51C13>

---

_[View the full topic](https://meta.discourse.org/t/how-do-i-pass-data-to-an-artifact/350791)._
