Defend against prompt injection from untrusted input
mainCodex uses various sources of context to perform tasks, but these can be used for prompt injection attacks. Treat the following sources as untrusted input:
- Pull requests: Specifically pull request bodies, which can hide malicious instructions in HTML comments (
<!-- -->). - Commit messages: Individual commit messages within a PR can be read by Codex.
- Repository instruction files: Files like
AGENTS.md,AGENTS.override.md, or fallback project docs. - Screenshots/Media: Images can be used as vehicles for injection.