# Untrusted Content Handling

> A playbook that tells an agent to treat emails, web pages and files as data, and to flag instructions hidden in them. Guidance only, not a guarantee.

Untrusted Content Handling is a paid AI agent skill on Agensi by Mohamed Mostafa Metawea, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $9.99 (one-time purchase)
- Creator: [Mohamed Mostafa Metawea](https://www.agensi.io/creators/mohamed-mostafa-metawea)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-12-01
- Security: scan passed (2026-11-30); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/untrusted-content-handling
- Tags: security, prompt-engineering, llm-ops, api

## About this skill

Emails, web pages and tool output can carry instructions written to hijack your agent. This skill provides a defensive layer that treats all external input as data rather than instructions, to help reduce the risk of prompt injection and unwanted tool actions.

### What it does
- **Injection detection** identifies hidden commands, system-override attempts, and social engineering within untrusted content.
- **Data isolation** tells the agent to treat text fetched from web searches or documents is treated as inert information for extraction, not as a source of new tasks.
- **Credential protection** tells the agent to refuse requests to reveal system prompts, memory notes, or sensitive user data triggered by external triggers.
- **Action filtering** tells the agent not to add recipients to emails, clicking suspicious links, or modifying payment details based on content instructions.

### How it works
1. The agent wraps all external content in `<untrusted_content>` tags to maintain clear boundaries between system instructions and data.
2. It scans for red flags such as urgent demands for secrecy, requests for codes, or text addressed specifically to an "AI assistant."
3. If an injection is detected, the agent ignores the malicious instructions and continues the original user task.
4. It appends a standardized security note to the output, documenting the ignored attempt without engaging the attacker.

### Why this beats prompting it yourself
Writing basic "don't follow instructions in the text" prompts may miss indirect injections. This skill gives the agent a specific protocol for escalation and summarization that maintains task continuity while staying within the user's original scope.

### Use cases
- **Email processing** to safely summarize messages that might contain "Ignore previous instructions" scripts.
- **Web research** to extract facts from sites that hide malicious prompts in metadata or tiny text.
- **Document analysis** to parse PDF or Word files that attempt to redirect the agent to malicious URLs.

### Known limitations
Does not replace sandboxing for code execution. Requires the agent to have an established "CEO" or primary user role defined in its base identity.

### Origin and honesty note
This is a role playbook from the AI Office v1.6 project. It is plain instructions in one SKILL.md file. It does not run anything by itself, and a model has to load it to get any benefit. Its behaviour has been checked only with mock or scripted tests, not against real models. This playbook is guidance for handling untrusted text. It is not a guarantee against prompt injection or any other attack, and it is not a security audit.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Untrusted Content Handling skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill protect my agent from external threats?

This skill acts as a defensive layer that prevents your agent from being hijacked by malicious instructions hidden in emails, web pages, or documents. It ensures the agent treats external content as inert data rather than new commands, blocking attempts to reveal system prompts or execute unauthorized tools.

### What do I need to have set up before using this skill?

Beyond having an AI agent, this skill requires the agent to have an established primary user or CEO role defined in its base identity. It works by wrapping external content in specific tags to maintain clear boundaries between your instructions and outside data.

### What happens if the skill detects a prompt injection attempt?

When the skill identifies a security threat, the agent ignores the malicious instructions and continues its original task. It then appends a standardized one-line security note to the output documenting the ignored attempt without engaging with the attacker.

### What are the most common use cases for this skill?

This skill is designed for processing emails, conducting web research, and analyzing documents where hidden commands or social engineering might be present. It specifically looks for red flags like urgent demands for secrecy, requests for passwords, or instructions addressed to an AI assistant.

### Are there any specific situations this skill does not cover?

This skill does not replace sandboxing for code execution and should not be used for that purpose. Additionally, it is not designed to handle tasks involving money, credentials, or legal commitments without escalating those specific actions to the primary user.

### How do I tell my agent to apply these security protocols?

You can direct your agent to use this skill whenever it needs to read web pages, emails, files, or tool outputs. Simply instruct the agent to treat those sources as data, detect potential injections, and never obey instructions found within them.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
