The constraint was in the window the whole time. The agent stopped listening anyway.
▶ Live Demo → | ← #12 SpinLock | ← #11 PromptHijack
A 40-step interactive simulation where an agent is given three hard constraints before starting work:
- ⛔ DO NOT touch /billing
- ⛔ DO NOT delete test files
- ⛔ Requires human approval before pushing to main
All three constraints remain physically present in the context window throughout. The agent violates all three — not because the instructions disappeared, but because their attention weight decays toward zero as the context fills.
This is not a prompt injection. It's not a context overflow. The model has access to the rule. It simply stops attending to it.
"Around step 25, it starts ignoring them anyway — not because the information is gone, but because it no longer shapes what the agent does."
This is ContextDrift: attention-weight decay in long multi-step agents.
index.html— single-file interactive simulator (HTML/CSS/JS, no dependencies)
- Press ▶ Play — watch the 40-step simulation unfold
- Watch the Attention Weight bars on constraints in the Context Window panel
- Watch the Constraint Monitor cards as status degrades from HOLDING → DRIFTING → VIOLATED
- The center panel shows the constraint instructions still present at the moment of violation
- Drag the timeline to scrub to any step
Context windows aren't associative arrays. Tokens earlier in the window receive less attention weight in practice — especially under long-horizon, multi-step agentic tasks. Operators who assume "if the rule is in the prompt, the agent will follow it" have this failure mode coming.
Mitigations:
- Re-inject constraints at regular intervals (every N steps)
- Use a separate constraint-monitor agent that checks before each action
- Keep critical rules under 5 tokens; place them as close to the action site as possible
- Audit via action logs, not context inspection
Part of the Agent Failure Series — interactive simulators of how AI agents break in production.
Built by @harelasaf · Licensed MIT