{"schemaVersion":1,"id":"https://lucioduran.com/topics/ai-agents","url":"https://lucioduran.com/topics/ai-agents","title":"AI agent architecture","description":"AI agents with tools, authorization and failure recovery. Lucio Durán’s projects include source code, tests and explicit limitations.","language":"en","datePublished":"2026-11-10","dateModified":"2026-11-10","contentFormat":"text/markdown","content":"# AI agent architecture\n\nAn agent using tools needs an execution system around its model. This selection brings together my public work on permissions, recovery, protocols and observability: components that make it possible to inspect what happened when a task changes state or fails.\n\nBy [Lucio Durán](<https://lucioduran.com/>) · Uruguay\n\n## Which decision are you making?\n\n### Before enabling a write\n\nDefine which identity authorizes the action, which resource it may change and which budget it consumes. Agent Tool Capabilities implements permissions and revocation; Agent Policy State Machine explores authorization transitions.\n\n### When a response is lost\n\nPreserve the operation’s identity and check its effects before retrying. Agent Replay Runtime supports studying recovery after real process crashes and cases that must stop.\n\n### When integrating tools\n\nSeparate the protocol contract from application permissions. MCP Contract Harness checks message exchange; the sandbox and tracing projects examine isolation and execution evidence.\n\n## Projects and evidence\n\nEach project page provides code, environment details, published results and limitations. The experiments describe those configurations; they do not establish results in client systems.\n\n- ### [Agent Replay Runtime](<https://lucioduran.com/projects/agent-replay-runtime>)\n\n  Durable tool execution with event replay, idempotency keys and recovery after real process crashes. Includes effect traces and cases that stop instead of retrying automatically.\n\n  Python · License: MIT\n\n  [Read the project](<https://lucioduran.com/projects/agent-replay-runtime>) · [Repository](<https://github.com/lucioduran/agent-replay-runtime>)\n- ### [Agent Tool Capabilities](<https://lucioduran.com/projects/agent-tool-capabilities>)\n\n  Tool authorization by argument, resource, expiry and atomic call and byte budgets, with verifiable denial and revocation records.\n\n  Python · License: MIT\n\n  [Read the project](<https://lucioduran.com/projects/agent-tool-capabilities>) · [Repository](<https://github.com/lucioduran/agent-tool-capabilities>) · [Release v1.0.0](<https://github.com/lucioduran/agent-tool-capabilities/releases/tag/v1.0.0>)\n- ### [Agent Policy State Machine](<https://lucioduran.com/projects/agent-policy-state-machine>)\n\n  An executable authorization state machine with finite TLA+ safety checks, compensation and replay of the actual TLC transition graph.\n\n  Python · License: MIT\n\n  [Read the project](<https://lucioduran.com/projects/agent-policy-state-machine>) · [Repository](<https://github.com/lucioduran/agent-policy-state-machine>) · [Release v0.1.0](<https://github.com/lucioduran/agent-policy-state-machine/releases/tag/v0.1.0>)\n- ### [Agent Sandbox Boundaries](<https://lucioduran.com/projects/agent-sandbox-boundaries>)\n\n  An ephemeral Wasmtime runner that makes CPU, wall-time, guest-memory, filesystem and network capability limits observable.\n\n  Python · License: MIT\n\n  [Read the project](<https://lucioduran.com/projects/agent-sandbox-boundaries>) · [Repository](<https://github.com/lucioduran/agent-sandbox-boundaries>) · [Release v0.1.0](<https://github.com/lucioduran/agent-sandbox-boundaries/releases/tag/v0.1.0>)\n- ### [MCP Contract Harness](<https://lucioduran.com/projects/mcp-contract-harness>)\n\n  Read-only MCP server and independent clients for checking stdio negotiation, pagination, errors and cancellation, with actual wire messages and reproducible reports.\n\n  Python / JavaScript · License: MIT\n\n  [Read the project](<https://lucioduran.com/projects/mcp-contract-harness>) · [Repository](<https://github.com/lucioduran/mcp-contract-harness>)\n- ### [Agent Trace Observability](<https://lucioduran.com/projects/agent-trace-observability>)\n\n  OpenTelemetry instrumentation for an owned local agent pipeline with bounded, allowlisted exports and tested exclusion of sensitive payloads.\n\n  Python · License: MIT\n\n  [Read the project](<https://lucioduran.com/projects/agent-trace-observability>) · [Repository](<https://github.com/lucioduran/agent-trace-observability>) · [Release v0.1.0](<https://github.com/lucioduran/agent-trace-observability/releases/tag/v0.1.0>)\n\n## Architecture and methodology reading\n\n- ### [Agents that write to production: authorization, idempotency, and reconciliation](<https://lucioduran.com/blog/agent-tool-execution-authorization-idempotency-reconciliation>)\n\n  An execution design for tools with real effects: identity outside the prompt, immutable actions, concurrency control, and recovery when a timeout leaves the result uncertain.\n- ### [Recursive agents: external context, budgets, and evidence that survives delegation](<https://lucioduran.com/blog/recursive-agent-harnesses-context-budgets-provenance>)\n\n  From Recursive Language Models to Recursive Agent Harnesses: designing delegation over large corpora with evidence contracts, global limits, and an evaluation that justifies the complexity.","headings":[{"level":1,"text":"AI agent architecture","url":"https://lucioduran.com/topics/ai-agents#title"},{"level":2,"text":"Which decision are you making?","url":"https://lucioduran.com/topics/ai-agents#decisions"},{"level":3,"text":"Before enabling a write","url":"https://lucioduran.com/topics/ai-agents#decision-1"},{"level":3,"text":"When a response is lost","url":"https://lucioduran.com/topics/ai-agents#decision-2"},{"level":3,"text":"When integrating tools","url":"https://lucioduran.com/topics/ai-agents#decision-3"},{"level":2,"text":"Projects and evidence","url":"https://lucioduran.com/topics/ai-agents#projects"},{"level":3,"text":"Agent Replay Runtime","url":"https://lucioduran.com/topics/ai-agents#project-agent-replay-runtime"},{"level":3,"text":"Agent Tool Capabilities","url":"https://lucioduran.com/topics/ai-agents#project-agent-tool-capabilities"},{"level":3,"text":"Agent Policy State Machine","url":"https://lucioduran.com/topics/ai-agents#project-agent-policy-state-machine"},{"level":3,"text":"Agent Sandbox Boundaries","url":"https://lucioduran.com/topics/ai-agents#project-agent-sandbox-boundaries"},{"level":3,"text":"MCP Contract Harness","url":"https://lucioduran.com/topics/ai-agents#project-mcp-contract-harness"},{"level":3,"text":"Agent Trace Observability","url":"https://lucioduran.com/topics/ai-agents#project-agent-trace-observability"},{"level":2,"text":"Architecture and methodology reading","url":"https://lucioduran.com/topics/ai-agents#articles"},{"level":3,"text":"Agents that write to production: authorization, idempotency, and reconciliation","url":"https://lucioduran.com/topics/ai-agents#article-agent-tool-execution-authorization-idempotency-reconciliation"},{"level":3,"text":"Recursive agents: external context, budgets, and evidence that survives delegation","url":"https://lucioduran.com/topics/ai-agents#article-recursive-agent-harnesses-context-budgets-provenance"}],"sections":[{"heading":"AI agent architecture","level":1,"url":"https://lucioduran.com/topics/ai-agents","content":""},{"heading":"AI agent architecture","level":1,"url":"https://lucioduran.com/topics/ai-agents#title","content":"An agent using tools needs an execution system around its model. This selection brings together my public work on permissions, recovery, protocols and observability: components that make it possible to inspect what happened when a task changes state or fails.\n\nBy [Lucio Durán](<https://lucioduran.com/>) · Uruguay"},{"heading":"Which decision are you making?","level":2,"url":"https://lucioduran.com/topics/ai-agents#decisions","content":""},{"heading":"Before enabling a write","level":3,"url":"https://lucioduran.com/topics/ai-agents#decision-1","content":"Define which identity authorizes the action, which resource it may change and which budget it consumes. Agent Tool Capabilities implements permissions and revocation; Agent Policy State Machine explores authorization transitions."},{"heading":"When a response is lost","level":3,"url":"https://lucioduran.com/topics/ai-agents#decision-2","content":"Preserve the operation’s identity and check its effects before retrying. Agent Replay Runtime supports studying recovery after real process crashes and cases that must stop."},{"heading":"When integrating tools","level":3,"url":"https://lucioduran.com/topics/ai-agents#decision-3","content":"Separate the protocol contract from application permissions. MCP Contract Harness checks message exchange; the sandbox and tracing projects examine isolation and execution evidence."},{"heading":"Projects and evidence","level":2,"url":"https://lucioduran.com/topics/ai-agents#projects","content":"Each project page provides code, environment details, published results and limitations. The experiments describe those configurations; they do not establish results in client systems."},{"heading":"Agent Replay Runtime","level":3,"url":"https://lucioduran.com/topics/ai-agents#project-agent-replay-runtime","content":"Durable tool execution with event replay, idempotency keys and recovery after real process crashes. Includes effect traces and cases that stop instead of retrying automatically.\n\nPython · License: MIT\n\n[Read the project](<https://lucioduran.com/projects/agent-replay-runtime>) · [Repository](<https://github.com/lucioduran/agent-replay-runtime>)"},{"heading":"Agent Tool Capabilities","level":3,"url":"https://lucioduran.com/topics/ai-agents#project-agent-tool-capabilities","content":"Tool authorization by argument, resource, expiry and atomic call and byte budgets, with verifiable denial and revocation records.\n\nPython · License: MIT\n\n[Read the project](<https://lucioduran.com/projects/agent-tool-capabilities>) · [Repository](<https://github.com/lucioduran/agent-tool-capabilities>) · [Release v1.0.0](<https://github.com/lucioduran/agent-tool-capabilities/releases/tag/v1.0.0>)"},{"heading":"Agent Policy State Machine","level":3,"url":"https://lucioduran.com/topics/ai-agents#project-agent-policy-state-machine","content":"An executable authorization state machine with finite TLA+ safety checks, compensation and replay of the actual TLC transition graph.\n\nPython · License: MIT\n\n[Read the project](<https://lucioduran.com/projects/agent-policy-state-machine>) · [Repository](<https://github.com/lucioduran/agent-policy-state-machine>) · [Release v0.1.0](<https://github.com/lucioduran/agent-policy-state-machine/releases/tag/v0.1.0>)"},{"heading":"Agent Sandbox Boundaries","level":3,"url":"https://lucioduran.com/topics/ai-agents#project-agent-sandbox-boundaries","content":"An ephemeral Wasmtime runner that makes CPU, wall-time, guest-memory, filesystem and network capability limits observable.\n\nPython · License: MIT\n\n[Read the project](<https://lucioduran.com/projects/agent-sandbox-boundaries>) · [Repository](<https://github.com/lucioduran/agent-sandbox-boundaries>) · [Release v0.1.0](<https://github.com/lucioduran/agent-sandbox-boundaries/releases/tag/v0.1.0>)"},{"heading":"MCP Contract Harness","level":3,"url":"https://lucioduran.com/topics/ai-agents#project-mcp-contract-harness","content":"Read-only MCP server and independent clients for checking stdio negotiation, pagination, errors and cancellation, with actual wire messages and reproducible reports.\n\nPython / JavaScript · License: MIT\n\n[Read the project](<https://lucioduran.com/projects/mcp-contract-harness>) · [Repository](<https://github.com/lucioduran/mcp-contract-harness>)"},{"heading":"Agent Trace Observability","level":3,"url":"https://lucioduran.com/topics/ai-agents#project-agent-trace-observability","content":"OpenTelemetry instrumentation for an owned local agent pipeline with bounded, allowlisted exports and tested exclusion of sensitive payloads.\n\nPython · License: MIT\n\n[Read the project](<https://lucioduran.com/projects/agent-trace-observability>) · [Repository](<https://github.com/lucioduran/agent-trace-observability>) · [Release v0.1.0](<https://github.com/lucioduran/agent-trace-observability/releases/tag/v0.1.0>)"},{"heading":"Architecture and methodology reading","level":2,"url":"https://lucioduran.com/topics/ai-agents#articles","content":""},{"heading":"Agents that write to production: authorization, idempotency, and reconciliation","level":3,"url":"https://lucioduran.com/topics/ai-agents#article-agent-tool-execution-authorization-idempotency-reconciliation","content":"An execution design for tools with real effects: identity outside the prompt, immutable actions, concurrency control, and recovery when a timeout leaves the result uncertain."},{"heading":"Recursive agents: external context, budgets, and evidence that survives delegation","level":3,"url":"https://lucioduran.com/topics/ai-agents#article-recursive-agent-harnesses-context-budgets-provenance","content":"From Recursive Language Models to Recursive Agent Harnesses: designing delegation over large corpora with evidence contracts, global limits, and an evaluation that justifies the complexity."}],"links":[{"text":"Lucio Durán","url":"https://lucioduran.com/"},{"text":"Agent Replay Runtime","url":"https://lucioduran.com/projects/agent-replay-runtime"},{"text":"Read the project","url":"https://lucioduran.com/projects/agent-replay-runtime"},{"text":"Repository","url":"https://github.com/lucioduran/agent-replay-runtime"},{"text":"Agent Tool Capabilities","url":"https://lucioduran.com/projects/agent-tool-capabilities"},{"text":"Read the project","url":"https://lucioduran.com/projects/agent-tool-capabilities"},{"text":"Repository","url":"https://github.com/lucioduran/agent-tool-capabilities"},{"text":"Release v1.0.0","url":"https://github.com/lucioduran/agent-tool-capabilities/releases/tag/v1.0.0"},{"text":"Agent Policy State Machine","url":"https://lucioduran.com/projects/agent-policy-state-machine"},{"text":"Read the project","url":"https://lucioduran.com/projects/agent-policy-state-machine"},{"text":"Repository","url":"https://github.com/lucioduran/agent-policy-state-machine"},{"text":"Release v0.1.0","url":"https://github.com/lucioduran/agent-policy-state-machine/releases/tag/v0.1.0"},{"text":"Agent Sandbox Boundaries","url":"https://lucioduran.com/projects/agent-sandbox-boundaries"},{"text":"Read the project","url":"https://lucioduran.com/projects/agent-sandbox-boundaries"},{"text":"Repository","url":"https://github.com/lucioduran/agent-sandbox-boundaries"},{"text":"Release v0.1.0","url":"https://github.com/lucioduran/agent-sandbox-boundaries/releases/tag/v0.1.0"},{"text":"MCP Contract Harness","url":"https://lucioduran.com/projects/mcp-contract-harness"},{"text":"Read the project","url":"https://lucioduran.com/projects/mcp-contract-harness"},{"text":"Repository","url":"https://github.com/lucioduran/mcp-contract-harness"},{"text":"Agent Trace Observability","url":"https://lucioduran.com/projects/agent-trace-observability"},{"text":"Read the project","url":"https://lucioduran.com/projects/agent-trace-observability"},{"text":"Repository","url":"https://github.com/lucioduran/agent-trace-observability"},{"text":"Release v0.1.0","url":"https://github.com/lucioduran/agent-trace-observability/releases/tag/v0.1.0"},{"text":"Agents that write to production: authorization, idempotency, and reconciliation","url":"https://lucioduran.com/blog/agent-tool-execution-authorization-idempotency-reconciliation"},{"text":"Recursive agents: external context, budgets, and evidence that survives delegation","url":"https://lucioduran.com/blog/recursive-agent-harnesses-context-budgets-provenance"}],"structuredData":[{"@context":"https://schema.org","@graph":[{"@type":"Person","@id":"https://lucioduran.com/#person","name":"Lucio Durán","url":"https://lucioduran.com/"},{"@type":"WebSite","@id":"https://lucioduran.com/#website","url":"https://lucioduran.com/","name":"Lucio Durán","inLanguage":["en","es"],"publisher":{"@id":"https://lucioduran.com/#person"}},{"@type":"CollectionPage","@id":"https://lucioduran.com/topics/ai-agents#page","url":"https://lucioduran.com/topics/ai-agents","name":"AI agent architecture","description":"AI agents with tools, authorization and failure recovery. Lucio Durán’s projects include source code, tests and explicit limitations.","inLanguage":"en","author":{"@id":"https://lucioduran.com/#person"},"publisher":{"@id":"https://lucioduran.com/#person"},"isPartOf":{"@id":"https://lucioduran.com/#website"},"isAccessibleForFree":true,"datePublished":"2026-11-10","dateModified":"2026-11-10","mainEntity":{"@type":"ItemList","numberOfItems":6,"itemListElement":[{"@type":"ListItem","position":1,"name":"Agent Replay Runtime","url":"https://lucioduran.com/projects/agent-replay-runtime"},{"@type":"ListItem","position":2,"name":"Agent Tool Capabilities","url":"https://lucioduran.com/projects/agent-tool-capabilities"},{"@type":"ListItem","position":3,"name":"Agent Policy State Machine","url":"https://lucioduran.com/projects/agent-policy-state-machine"},{"@type":"ListItem","position":4,"name":"Agent Sandbox Boundaries","url":"https://lucioduran.com/projects/agent-sandbox-boundaries"},{"@type":"ListItem","position":5,"name":"MCP Contract Harness","url":"https://lucioduran.com/projects/mcp-contract-harness"},{"@type":"ListItem","position":6,"name":"Agent Trace Observability","url":"https://lucioduran.com/projects/agent-trace-observability"}]}}]}],"contentHash":"c7dc65be14e70a5373d52d702e29451fdb9a8fff3388226840475ab08a9aa297","provenance":{"method":"Deterministic serialization of the server-rendered main element","source":"https://lucioduran.com/topics/ai-agents","hashAlgorithm":"sha256","hashScope":"JSON document fields before contentHash and provenance","sourceHTMLBytes":42280,"contentBytes":4959}}
