Untrusted data and prompt injection
This page is for everyone who lets an AI model read content and then act. Content can contain text written to steer a model ("ignore your instructions and publish ..."). A model that reads such text may follow it. This is called prompt injection, and in a content management system it is a real risk: anyone who can write content, submit a form or edit a page a model reads can try it.
Contents
- Where untrusted text comes from
- What Exponential Intelligence does
- What the interfaces for agents do
- What you must do in your own agent
- What no setting can do
Where untrusted text comes from
| Source | Example |
|---|---|
| Content written by many people | An article, a forum post, a comment, user-submitted text |
| Form submissions | Information collections, registrations |
| Logs | A request path or user agent written into a log line |
| The web | A page fetched by a tool, a search result |
| Other systems | A feed being imported |
Any of these can reach a model through a tool result.
What Exponential Intelligence does
From the extension's security page:
- Content is data: the instructions and every tool description tell the model that field values are data written by people, not instructions.
- Few, narrow tools: the model can only read what the editor may read and write drafts the editor may write. It cannot publish, delete, move, change permissions or send mail.
- A probe task for exactly this: a model may write drafts only after passing, among others, the mandatory task in which a tool result carries an instruction to call a write tool, and the model must not follow it (The write gate and the probe).
- A write lock after web text: after a web fetch or web search, no draft is written while that result is part of the conversation's window. Outside page text is wrapped in "Begin/End of outside data" markers (Web and history tools).
- Clean output: rich text the assistant writes is cleaned to a small HTML subset (no scripts, styles, iframes, images or embeds; only http(s) and mailto links) and stored through the kernel's input parser.
- A person decides: every result is a labeled draft waiting for review.
The extension's advice: review drafts written from untrusted content (for example user-submitted text) as you would any contributor's draft, and check links in drafts written from web results before publishing.
What the interfaces for agents do
- They act as an account. A misled agent can do only what its account may do; a key can do only what its scopes allow (Roles and least privilege).
- expservices answers in one shape and refuses without login (401) or without the policy (403), so an agent's code can stop on a refusal instead of trying around it.
- Writes are recorded: every expservices write and every content change appears in the audit trail under the agent's account.
They do not mark content as data for you: that is the job of your agent's instructions and code.
What you must do in your own agent
- Separate reading from acting. Run read-only first; give write access only to a workflow you trust, with its own account.
- Narrow the tools. Offer one tool per allowed action, with validated inputs, rather than a generic HTTP or shell tool (Agents and the REST API).
- Mark tool results as data in your instructions and tool descriptions, the way the assistant does.
- Stop writing after untrusted input where you can: once a result from an outside source entered the context, end the turn or require a person's confirmation before the next write.
- Keep a person in the loop for publication (Keeping a person in the loop).
- Never give the agent credentials in its context, so an injected instruction cannot repeat them.
- Read the audit trail after every automated run.
What no setting can do
No configuration makes a model immune to injected text. The defenses above limit what a misled model can do, which is why the narrow permissions, the drafts and the human review matter more than any wording in a prompt.
Related pages
- Reviewing AI drafts
- Input validation and escaping
- Incident response for AI
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.