Agentic AI Notebook
Context Engineering
Phase 6Module 13 of 15

Context Pollution

Quality bugs that look like the model got dumber are often a dirty window.

A desk piled with last week's mail. You miss the invoice.

Visual Workflows

Start here — scroll inside each diagram frame to explore, then use + / to zoom up to 200% if needed.

Overview

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

This turn

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

A desk piled with last week's mail. You miss the invoice.

Key Takeaways

  • 1.Pollution is leftover, contradictory, or injected text that changes behavior.
  • 2.Symptoms: ignored tools, sudden policy changes, looping.
  • 3.Causes: unfenced RAG, huge traces, stale summaries, duplicate memories.
  • 4.Fix by isolating, compacting, and dropping duplicates.
  • 5.Quality bugs that look like the model got dumber are often a dirty window.

Real Example

Scenario

Pollution: pack only what this turn needs.

What you would do

In Context Engineering, apply Context Pollution to this scenario: Pollution: pack only what this turn needs. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Commands

Commands to Remember

  • Pollution is leftover, contradictory, or injected text that changes behavior
  • Symptoms: ignored tools, sudden policy changes, looping
  • Causes: unfenced RAG, huge traces, stale summaries, duplicate memories
  • Fix by isolating, compacting, and dropping duplicates

Cheat Sheet

Quick recap

quick ref
  • Pollution
  • Budget
  • Don't dump

Common Mistakes

  • Skipping evaluation for Context Pollution before production
  • No logging or tracing around context pollution steps
  • Ignoring cost and latency implications