Local AI Agent
A local AI agent for the terminal. It runs on Ollama, executes commands inside a sandbox, and asks for approval before any risky action. Everything runs locally, so no API key is needed and no data leaves the machine.
01Interface
02How it works
From user task to final result
01 / INPUT
User task
The folder the agent is launched from becomes its working directory
02 / LOOP
Agent core
Orchestrates steps and enforces a step limit
03 / MODEL
Model response
The model either answers or requests a tool call
04 / TOOLS
Tool registry
The call is validated against the registry before it runs
05 / GUARD
Permission layer
Safe: run · Dangerous: block · Anything else: show the exact action and ask
06 / SANDBOX
Isolated execution
bubblewrap, with the network closed and the home directory hidden
07 / EXECUTE
Local tools
Shell commands, file reads and writes, and Git
08 / OBSERVE
Evaluate outcomes
Classifies the outcome and applies the retry rules
The result returns to the model to continue the task, within a step limit. The same tool with the same arguments runs at most twice, a refusal from the user is not treated as a technical error, and dangerous actions are never retried automatically.
03System architecture
The diagram shows the target architecture. Everything in it is built except Skills, Connectors and the Planner, which are still planned.
04Details
Safety controls
Permission layer
Every tool call is classified before it runs. Known-safe commands run directly, dangerous ones are blocked, and everything else shows the exact action and waits for a yes or no.
bubblewrap sandbox
The network is closed by default, the home directory is hidden, /usr and .git are read-only, .env is hidden, and the environment is cleared. If bubblewrap is missing the agent refuses to run commands rather than falling back silently.
Scoped file access
File tools are confined to the working directory and block sensitive files. Git tools stay outside the sandbox and do not support push, reset, or shell access; commits require approval.
Notes as untrusted data
Saving a note always shows the exact text and asks for approval. The model never touches the database directly, saved notes are given to it as untrusted data rather than instructions, and secrets are rejected by pattern and length checks.
Stack
Implemented
Planned
Status
Work in Progress
By
eh7r
Platform
Linux (bubblewrap)
Tests
468 pytest tests
Install
pipx · openagent
License
PolyForm Noncommercial 1.0.0
05Known limitations
Stated by the author, not smoothed over.
- Arabic display has only been tested in kitty.
- A cancelled request keeps running in Ollama until it finishes.
- A small gap appears after "لا" inside some Arabic words, probably caused by the font.