Agents as Software: A Programming Languages Agenda for Agent Reliability
Organizations: Microsoft Research Redmond, USA · University of Wisconsin-Madison Madison, USA
Abstract
AI agents increasingly resemble software systems: they call tools, remember facts, follow policies, delegate work, and take actions with real consequences. % Yet the ``program'' of an agent is scattered across prompts, tools, memories, workflows, and execution traces, making its behavior difficult to inspect through ordinary testing and debugging alone. % This essay argues that a programming-systems perspective offers a natural lens for making agents reliable. % We recast agents as programmable artifacts whose behavior can be specified over traces and state, checked before deployment, monitored during execution, and improved from observed failures. % The goal is not to make probabilistic agents behave like deterministic programs, but to give them enough structure that their behavior can be reasoned about, controlled, and repaired.
Figures & tables
| Spec example | Property kind | Logic | Usage |
|---|---|---|---|
| Tool inputs/outputs must satisfy the given pre/post- condition | Interface correctness | FOL | R |
| Every Acquire(r) must have a matching Release(r) later before another Acquire(r) | Resource well-formedness | Regexes over trace vocabulary | R |
| Cannot issue delete_resource(r) without prior Owns(agent, r) in session | Action admissibility | LTL | R |
| Order retrieval must be preceded by an authentication of the corresponding customer | Action admissibility | LTL | R |
| confirmation_token argument equals token from prior request_confirmation ; not reused | Input integrity (freshness / use-once) | Session types | R |
| Capabilities held by subagent capabilities held by parent at spawn | Permission discipline | Permission Logics | R |
| Phase | Analysis Technique | What It Checks | Artifact / Object |
|---|---|---|---|
| Static Analysis | Prompt testing and analysis | Are task obligations explicit? Does the prompt specify when to call tools, stop, escalate, or ask for confirmation? | Prompt text |
| Tool contract validation | Are tool preconditions, effects, and required evidence explicit? Are high-impact actions guarded? | Tool schemas | |
| Cross-artifact consistency | Can individually safe artifacts compose into unsafe behavior? Do the prompt, tools, and policies fit together, or do they create gaps where the agent can take an unsafe action? | Prompt Tools Policy | |
| Information-flow analysis | Can untrusted information influence sensitive actions without validation? | Dataflow across artifacts | |
| Abstract interpretation | Can an unsafe action become reachable before its required evidence, authorization, or confirmation is established? | Abstract agent state | |
| Dynamic Analysis | Runtime state tracking | What facts, permissions, constraints, obligations, and provenance are established by the current execution prefix? | Execution prefix |