OnPrem.LLM AgentExecutor: Launch Sandboxed AI Agents with Built-in Tools

The AgentExecutor from OnPrem.LLM enables autonomous AI agents to execute complex tasks using both cloud and local models. The pipeline works with any LiteLLM-supported model that supports tool-calling, including cloud models like OpenAI's GPT-5.2-Codex, Anthropic's Claude Sonnet 4.5, and Google's Gemini 1.5 Pro, as well as local models through Ollama, vLLM, or llama.cpp.
Built-in Tools
By default, AgentExecutor provides access to nine built-in tools:
read_file- Read complete file contentsread_lines- Read specific line ranges from filesedit_file- Edit files via find/replacewrite_file- Write complete file contentsgrep- Search for patterns in filesfind- Find files by glob patternrun_shell- Execute shell commandsweb_search- Search the web for informationweb_fetch- Fetch and read content from URLs
Configuration Examples
You can customize tool access based on your security requirements:
# Use defaults (all tools including shell):
executor = AgentExecutor(model='anthropic/claude-sonnet-4-5')
Defaults but no shell access (safer):
executor = AgentExecutor(
model='openai/gpt-5-mini',
disable_shell=True
)
Minimal tools:
executor = AgentExecutor(
model='openai/gpt-5-mini',
enabled_tools=['read_file', 'write_file']
)
Web research only:
executor = AgentExecutor(
model='openai/gpt-5-mini',
enabled_tools=['web_search', 'web_fetch']
)
Sandboxed Execution
For security, you can run agents in ephemeral containers using sandbox=True. This is important because agents with shell access can potentially read or modify files outside the working directory. The agent operates within the specified working directory and cannot read or write outside it unless given shell access.
Basic example with sandboxing:
executor = AgentExecutor(
model='anthropic/claude-sonnet-4-5',
sandbox=True,
)
result = executor.run(
task="""
Create a simple Python calculator module with the following:
- calculator.py with add, subtract, multiply, divide functions
- test_calculator.py with pytest tests
- All tests must pass
""",
working_dir='./calculator_project'
)
This approach is useful for developers who need to automate coding tasks while maintaining security boundaries. The tool requires installing PatchPal with pip install patchpal.
📖 Read the full source: HN AI Agents
👀 See Also

GLM-5-Turbo Shows Low Tool Call Error Rate in User Testing
The z-ai/glm-5-turbo model demonstrates a 0.57% average tool call error rate in testing, significantly lower than GLM-5's ~3% rate. A user reported successfully using it with a CLI tool to write a 97,000-word fantasy novel with minimal issues.

Open-source Claude Code skill diagnoses AI adoption roadblocks
An MIT-licensed Claude Code skill analyzes where companies get stuck with AI adoption—tooling, culture, or measurement—and builds 90-day plans with named owners. Based on interviews with 100+ founders and board members.

Brunnfeld Agentic World: Multi-Agent Medieval Economy Simulation Without Behavioral Prompts
A TypeScript simulation where 20 LLM agents autonomously trade in a medieval village economy with no behavioral instructions, goals, or trading strategies. Agents receive ~200 token perceptions each tick and interact through a deterministic engine handling physics, recipes, and market mechanics.

Codegraph: Pre-indexed knowledge graph cuts Claude/Cursor tool calls by 94%
Codegraph uses a pre-indexed knowledge graph of symbol relationships, call graphs, and code structure to reduce API tool calls by up to 94% and speed up usage by ~77% for Claude, Cursor, Codex, and OpenCode agents.