context

Treat Context Like Code to Scale AI Agents With Control

Patrick Debois proposes something quietly radical: treat context like code.

3 min readInfoQ
Treat Context Like Code to Scale AI Agents With Control

Patrick Debois has done something quietly radical: he has taken the messy, human art of giving instructions to an AI and proposed we treat it with the same rigor we apply to shipping software. His argument that context should be managed like code, tested, versioned, scanned for security, and distributed through package managers, is not just clever. It is the most practical framework we have seen for scaling AI agents without losing control. For engineering leaders who have watched their teams struggle with non-deterministic outputs, this is a direct answer to a problem that has felt unsolvable.

The insight here is that context is not a conversation. It is infrastructure. When you treat the prompts, examples, and constraints you feed an AI agent as software artifacts, you unlock the same benefits that DevOps brought to code deployment: reproducibility, auditability, and incremental improvement. Debois's approach aligns closely with the philosophy behind Atlassian Upgrades Metrics Pipeline to OpenTelemetry Without Disrupting Alerts, both stories recognize that reliable systems require clean, observable pipelines. Just as Atlassian replaced a brittle metrics tool with OpenTelemetry to avoid breaking alerts, Debois is arguing that your AI agent's context pipeline should be equally intentional. You would not deploy code without a test suite, so why deploy a prompt without one? The practical consequence is immediate: teams can finally treat AI agent behavior as something to be shaped and measured, not guessed at.

This also connects to a broader shift in how we think about operational control. The Cloudflare's new Vary controls put cache efficiency back in your hands story shows how giving engineers explicit control over caching headers can improve performance without sacrificing flexibility. Debois is doing the same for AI context, giving teams explicit, code-level control over what the agent sees and how it behaves. The difference is that context is far more volatile than a cache header, which makes his call for CI/CD pipelines and security scanning even more urgent. If you do not version your context, you cannot roll back a bad agent output. If you do not scan it, you might accidentally embed a security vulnerability in the instructions themselves.

The specific takeaway here is direct: start treating your most effective prompts as code artifacts today. Write a test that asserts the agent does not return sensitive data. Add a CI step that validates context against a schema. Package your best-performing context blocks into a library your team can import. Debois has shown the destination; the open question is whether engineering teams will adopt the discipline before the chaos of unmanaged AI agents forces their hand. The choice is yours, but the window for getting ahead of this is narrowing fast.

From InfoQ

Patrick Debois discusses how to manage, evaluate, distribute, and observe context using proven software engineering practices. He shares how treating context like code - complete with testing, CI/CD, package managers, and security scanning - enables engineering leaders to reliably scale AI coding agents, maintain control over non-deterministic outputs, and build long-term organizational knowledge.

Read the original at InfoQ