---
title: "Designing AI agents to resist prompt injection"
description: "Real-world prompt injection against AI agents increasingly resembles social engineering rather than simple instruction overrides, so input-classifying \"AI firewalls\" largely fail."
url: "https://swe.quest/articles/designing-ai-agents-to-resist-prompt-injection-e50499550a206fae"
canonical: "https://openai.com/index/designing-agents-to-resist-prompt-injection"
source: "OpenAI"
published: "2026-03-11"
difficulty: "easy"
kind: "Opinion"
reading_minutes: 6
tags: ["ai-safety","ai-agents","security","llms"]
---

# Designing AI agents to resist prompt injection

A post on [OpenAI](https://swe.quest/sources/openai.md), published 2026-03-11, 6 min read, Opinion. Original: [https://openai.com/index/designing-agents-to-resist-prompt-injection](https://openai.com/index/designing-agents-to-resist-prompt-injection)

## Summary

Real-world prompt injection against AI agents increasingly resembles social engineering rather than simple instruction overrides, so input-classifying "AI firewalls" largely fail. Detecting such attacks becomes as hard as detecting lies, often without the needed context. OpenAI therefore treats agents like human customer-support staff: assume some manipulation will succeed and constrain its impact with deterministic controls. In ChatGPT this pairs safety training with source-sink analysis and a mechanism called Safe Url, which detects when conversation data would be sent to a third party and either asks the user to confirm or blocks the action. The same approach covers Atlas, Deep Research, Canvas and Apps sandboxes, and the recommendation is to give agents the controls a human in the same role would have.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [AI safety](https://swe.quest/tags/ai-safety.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Security](https://swe.quest/tags/security.md) (Security)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- LLM agents and tool use ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- prompt injection basics ([easy posts on Application security](https://swe.quest/tags/appsec.md?difficulty=easy))

## Keywords

prompt injection, Safe Url, ChatGPT, Atlas, Deep Research, source-sink analysis

## Related posts

- [Continuously hardening ChatGPT Atlas against prompt injection](https://swe.quest/articles/continuously-hardening-chatgpt-atlas-against-prompt-injection-a9a9178548b95727.md): OpenAI · 2025-12-22 · Easy · 11 min read · AI safety, AI agents, Application security, Model training, LLMs
  OpenAI hardens the ChatGPT Atlas browser agent against prompt injection using an LLM attacker trained end-to-end with reinforcement learning.
- [How we detect frontier model misalignment](https://swe.quest/articles/how-we-detect-frontier-model-misalignment-98ddf97507c137b5.md): OpenAI · 2026-10-29 · Medium · 15 min read · AI safety, AI agents, Threat detection, Evaluation, Sandboxing & isolation
  OpenAI monitors frontier agents across training, evaluation, internal use and some external deployment with a four-layer pipeline: high-recall activation probes (L0), a model-based reviewer of the agent's context window (L1), security and alignment investigative agents that can run code and read full transcripts (L2), and cross-case analysis against network logs and telemetry (L3).
- [How to Secure AI Agents: A Practical Overview for Development Teams](https://swe.quest/articles/how-to-secure-ai-agents-a-practical-overview-for-development-teams-8ef3e4fd91efa459.md): Docker · 2026-06-02 · Easy · 9 min read · AI agents, Sandboxing & isolation, Identity & auth, Security, Observability
  AI agents need a different security model than traditional services because they select tools, chain actions and act on credentials autonomously, widening the blast radius of prompt injection or tool poisoning.
- [AI threats in the wild: The current state of prompt injections on the web](https://swe.quest/articles/ai-threats-in-the-wild-the-current-state-of-prompt-injections-on-the-web-dd07a8b49e6e2d0a.md): Google Online Security Blog · 2026-04-23 · Easy · 7 min read · AI safety, Threat detection, LLMs, AI agents
  A scan of Common Crawl snapshots for indirect prompt injections finds that most in-the-wild attempts are low-sophistication: pranks, helpful guidance for AI summaries, SEO manipulation, AI-crawler deterrents such as infinite-text tarpits, and a few crude exfiltration and file-deletion attempts.
- [Google Workspace’s continuous approach to mitigating indirect prompt injections](https://swe.quest/articles/google-workspace-s-continuous-approach-to-mitigating-indirect-prompt-injections-c8fc2d3d2baf24db.md): Google Online Security Blog · 2026-04-02 · Easy · 5 min read · AI safety, LLMs, Application security, AI agents
  Google treats indirect prompt injection against Workspace with Gemini as an ongoing problem handled by a continuous loop: discover attacks, expand them with synthetic data, refine defenses, and measure the result.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
