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

Claude Code Skill Delegates Coding to Mistral/DeepSeek: 57M Tokens Saved, 90-100% Cost Reduction
A Claude Code skill called vibe-skill delegates low-level coding to cheap models like Mistral or DeepSeek while keeping Claude's planning. After 254 runs over 10 days, it saved 57M tokens and achieved 90-100% cost savings with 98% success rate.

Custom WhatsApp Channel Plugin for Claude Code Using Baileys
A developer built a custom channel plugin that adds WhatsApp support to Claude Code 2.1.80+ using Baileys v7, implementing the WhatsApp Web Multi-Device protocol as an MCP server with the experimental claude/channel capability.

Traversable Skill Graph for Persistent AI Agent Memory in Codebases
A developer built a three-layer skill graph system that lives inside a codebase, enabling AI coding assistants to maintain persistent memory across sessions. The system uses progressive disclosure with self-directing instructions instead of monolithic context files.

Smriti: A Git-like system for managing LLM reasoning state to prevent conversation drift
Smriti is an open-source tool that lets developers save, restore, branch, and compare reasoning states in LLM conversations to prevent drift. It treats interactions as state rather than chat history, allowing clean rollbacks and alternative exploration without contamination.