Skip to content

Example: complete least-privilege OpenRouter setup

This example gives a parent model access only to the agents orchestration surface. The spawned agent can read repository files and fetch public web content, but cannot write files or execute arbitrary processes.

Workspace

text
project/
└── .agents/
    └── agents/
        └── investigator.toml

.agents/agents/investigator.toml

toml
name = "investigator"
description = "Investigates repository issues using read-only files and public web research"
instructions = "Inspect repository evidence first. Use public web research only when needed. Do not modify files and do not execute local programs."

model_provider = "openrouter"
model = "openai/gpt-5.6-luna"
reasoning_effort = "high"
max_turns = 32

allow_tools = [
  "filesystem/*",
  "fetch/*",
]

[mcp_servers.filesystem]
type = "stdio"
command = "tuls"
args = ["filesystem", ".", "--allow", "filesystem.read"]

[mcp_servers.fetch]
type = "stdio"
command = "tuls"
args = ["fetch", "--allow", "network.fetch"]

Start environment

bash
cd /absolute/path/to/project
export OPENROUTER_API_KEY='...'
tuls agents . --allow agents.run

Effective permissions

LayerGrantedNot granted
Parent MCP surfaceagents.runfilesystem, fetch, memory, shell directly
Subagent child policyfilesystem/*, fetch/*shell, memory, undeclared child servers
Child filesystem serverfilesystem.readfilesystem.write
Child fetch servernetwork.fetch, public-network defaultprivate network, redirects
OS process boundarynormal account permissionsnot sandboxed by tuls

This layered model is the recommended pattern: grant the model only the tool families it needs, and independently restrict each child MCP process to the minimum operation set required for its role.

Related

MIT licensed · built for MCP 2026-07-28