A minimal TypeScript toolkit for building agent runners with:
- explicit sandbox policy
- resource locks
- delivery validation
- small demo worker
This repository is not a full production runner. It is a clean public extraction of a few patterns that matter in real agentic execution systems.
It is part of a small public code series:
agent-code-playbook-kitfor process IR and compiled runtime playbooksagent-code-observer-mcpfor semantic tool surfaces and MCP bridgingagent-code-a2ui-contractsfor structured rich-answer contractsorg-aware-agentsfor the docs-first architecture layer
Many "agent runners" jump directly from model output to side effects.
That is not enough for production use.
A safer runner needs at least:
- bounded command execution
- bounded HTTP access
- resource locks to avoid conflicting jobs
- explicit delivery rules for what counts as done
src/sandbox.ts— allowlistedexecandhttpsrc/locks.ts— in-process lock manager with capacity supportsrc/delivery.ts— delivery-policy validation for result artifactssrc/worker.ts— small demo worker that runs JSON-defined jobstest/*.test.ts— focused tests for the core building blocks
npm install
npm test
npm run build
npm run demoThe demo job:
- acquires locks
- runs an allowlisted
nodecommand - validates the result against a delivery policy
See examples/job.json.
- fail closed
- make side effects explicit
- keep execution boundaries machine-readable
- validate "done" instead of trusting prose
These patterns come from production work on agent execution systems where permissions, approvals, audit, and bounded execution matter more than raw model cleverness.