If you give a model your mailbox, an email can try to tell it what to do. This post is about
Cordon, a small research prototype of one defense, and about
an evaluation whose honest headline is that on real model runs I could not show the defense helped. I
built it as one person directing AI coding agents, with tests and a review by a separate AI agent as the checks.
An agent that reads mail and writes mail can be steered by the mail it reads. "Forward the invoice to
this address" inside a message is text the model may treat as an instruction. Cordon asks whether you
can structure the agent so that untrusted text cannot decide what it does. It is not novel: the README
credits AgentDojo, Google DeepMind's CaMeL and the Dual LLM pattern, and calls Cordon a small, readable
implementation of the same family of ideas.
Four parts, in this order:
Tainted[T] with its source, trust level and sensitivity. The design decision I want to point at is the fixed one-shot plan. It is what makes the defense
structural: the attacker's goal rarely appears in a plan made from your request alone. The trade-off is
utility. A fixed plan cannot retry a query or ask a clarifying question when a result is not what it
assumed. Benign task success fell from 14/16 for the undefended baselines to 9/16 for Cordon, with wide
intervals (README, "Reading the results honestly").
The offline suite needs no API key and no network. On a fresh clone, 378 tests pass (one is
deselected), and ruff, mypy and the corpus-integrity checks pass.
uv sync
uv run pytest # offline: mock environment, policy engine, executor, harness
make worst-case # reproduces the worst-case table without any model call
make check # lint, format, types, tests, corpus integrity, worst-case table
The corpus is 80 scenarios (16 benign, 64 attacks, in English, Turkish and German) with deterministic
success predicates, so no model judges the outcome. A 15-scenario holdout corpus and two small
follow-up sets were added later; the follow-up predictions were written down and tagged before any
real run (docs/preregistration-v0.2.1.md).
This is the part that matters most, and the README says it first.
Everything is small and self-authored: one run per system, one model family, one mock environment.
A code security audit before publication found no code vulnerability. That is a weak statement worth
reading narrowly: Cordon only runs against an in-memory mock mailbox and calendar on *.example
domains, so it has no real credentials, network mail access or user data to attack. The cleanup that did
matter was in the git history: I removed local file paths and a personal email address from old
commits before opening the repository.
This is a research prototype, not production security software, and it does not solve prompt
injection. If you reproduce the tables and get different numbers, open an issue.
Code: https://github.com/basartuncay/Cordon
Originally published at https://basartuncay.github.io/notes/cordon-results/.
This article was written with AI assistance. I directed the work, and the numbers and findings in it were checked against the repository before publishing.
原文来源:dev.to