Episode

Optimizing AI Agent Context Quality

Birgitta Böckeler explores the distinction between codified and ambient context in agentic software development. Learn how to apply the CAFES framework to improve signal-to-noise ratios, resolve data conflicts using code as a source of reality, and implement deterministic security controls for enterprise AI systems.

The Context Quality Imperative

In the rapidly evolving landscape of agentic software development, the primary bottleneck is no longer model capability but context quality. Birgitta Böckeler, Principal Engineer at Unblocked, argues that the industry must move beyond treating all data as generic "context" and instead distinguish between two distinct categories: codified and ambient context. Codified context consists of deliberately authored, reusable assets such as skills, rules, and architecture documents, which require version control and evaluation. Ambient context, conversely, is dynamic environmental data from Slack, PRs, and wikis, which requires real-time retrieval and reconciliation. Conflating these two leads to inefficient workflows and degraded agent performance.

The CAFES Framework

To operationalize context quality, Böckeler introduces the CAFES framework (Clarity, Actionability, Fidelity, Efficiency, Security). Fidelity and Efficiency are critical for ambient context, where agents must trust the truth of the data and maintain a high signal-to-noise ratio. Without proper filtering, agents suffer from "context overload," where excessive data distracts the model, or "context starvation," where fragmented MCP servers prevent the agent from accessing relevant information. The framework emphasizes that security is an overarching constraint, not an afterthought, requiring deterministic controls that operate independently of the LLM's probabilistic nature.

Strategic Implementation

Organizations must implement a context engine that ingests, evaluates, assembles, and observes ambient data. A key strategic advantage in software delivery is the use of code as a "source of reality." When conflicts arise between documentation and chat logs, the current state of the code often provides the definitive answer. Additionally, deriving expert graphs from commit history allows systems to weight information based on author authority. Security must be handled via least-privilege access controls applied before data reaches the agent, preventing prompt injection and data leakage. By treating context as a managed product with its own lifecycle, engineering teams can significantly reduce rework and improve the autonomy of their AI agents.

Conclusion

The future of agentic coding depends on the precision of context engineering. Teams must adopt structured frameworks to manage the complexity of multi-source data, ensuring that agents operate with high-fidelity, secure, and relevant information tailored to specific workflow stages.

Key insights

Context is not a monolithic entity; it must be categorized into codified (reusable, versioned) and ambient (dynamic, environmental) types to apply the correct engineering practices.
Impact: Prevents maintenance errors and ensures that stable instructions are not overwritten by transient environmental data.
Context Architecture →
The CAFES framework provides a measurable standard for context quality, with Fidelity and Efficiency being the primary drivers of agent success in complex environments.
Impact: Enables teams to systematically audit and improve the signal-to-noise ratio of their AI systems.
Quality Assurance →
Code serves as a powerful "source of reality" for resolving conflicts in ambient context, allowing systems to automatically settle contradictions between stale documents and current implementations.
Impact: Reduces manual intervention in conflict resolution and increases the accuracy of agent decision-making.
Data Reconciliation →
Security controls must be deterministic and applied outside the LLM decision loop to guarantee compliance with least-privilege principles and prevent prompt injection.
Impact: Mitigates critical risks of data leakage and unauthorized access in enterprise AI deployments.
Security & Compliance →
Fragmented MCP server integrations can lead to "context starvation," where agents stop retrieving data after the first few sources, missing critical information available in other systems.
Impact: Highlights the need for unified context engines to ensure comprehensive data recall and precision.
System Integration →

Action items

Audit existing agent configurations to classify all context inputs as either codified or ambient, and implement separate versioning and monitoring workflows for each.
Impact: Improves maintainability and ensures that reusable instructions are treated as code assets.
Implement deterministic permission checks and data filtering layers that operate before context is passed to the LLM, ensuring strict adherence to security policies.
Impact: Eliminates reliance on probabilistic LLM behavior for security-critical decisions.
Develop conflict resolution logic that prioritizes the current state of the codebase over documentation or chat logs when discrepancies are detected.
Impact: Automates the resolution of stale data issues, reducing agent hallucinations and errors.
Consolidate multiple MCP servers into a unified context engine or implement a retrieval orchestration layer to prevent early termination of data fetching.
Impact: Ensures agents have access to the full breadth of relevant organizational knowledge.
Apply the CAFES framework to evaluate context quality in critical workflow stages, specifically focusing on Fidelity and Efficiency metrics during the planning phase.
Impact: Identifies and rectifies low-quality context sources before they impact agent performance.

Quotes

“Overwhelming the agent with context, that's always going to be bad. It's going to have too much context. It's not going to listen to the right pieces.”
“So fidelity is how much can the agent trust the truth of the context that it gets. And efficiency is what's the signal to noise ratio”
“In the software delivery domain, we have this big advantage of having that piece of truth or at least reality in the middle of it that can really help make, yeah, settle a lot of or put a lot of balance into this system.”