Autonomous agent loops
A bounded plan, act, check loop for autonomous agents, run inside throwaway containers with hard limits on steps, time and spend.
Parts
- Goaltask brief
- Plannernext step
- ExecutorDocker sandbox
- Checkertests, limits
- Run logsteps, tokens, time
Objectives
- Explore a bounded loop for autonomous agents: plan one step, act, check, repeat.
- Run every action inside a disposable container, never on the host.
- Enforce hard limits on steps, wall-clock time and model spend.
- Record enough about each run to understand afterwards why it succeeded or stopped.
Architecture
A planner reads the task brief and the history so far, and proposes exactly one next step. An executor runs that step inside a throwaway Docker container with no access to the host's files. A checker looks at the result, runs any tests that define success, and decides whether to continue, stop with success, or stop with failure. Every step, token count and duration goes into the run log.
Implementation notes
- One step at a time keeps the planner honest. Plans of ten steps tend to be wrong by step three, while a single next step can be checked.
- Limits live outside the model. The loop stops on step count, time or spend no matter what the planner wants.
- The container is created per run and destroyed afterwards, so state cannot leak between runs.
- The checker uses concrete signals wherever possible, such as tests passing or a file existing, rather than asking the model whether it is done.
Results
Sample entry. This experiment is archived. Summarise what you learned here with evidence from the run logs: which kinds of task the loop handled, where it stalled, and what the limits caught.
Limitations
- Tasks without a concrete success signal are hard to check, so the loop tends to stop early or run until a limit.
- Container start-up adds latency to every step.
- The planner sees a summary of history, not all of it, and summaries lose detail.
Future improvements
These are kept for whoever picks the idea up again:
- Let the checker ask a person for a decision at defined points, instead of only continuing or stopping.
- Cache container images per task type to reduce start-up time.
- Replay a recorded run step by step to debug planner decisions.