Loading…
Loading…
Features · Control · Permissions
Every tool call passes a permission gate before it runs. The gate allows it, denies it, or asks: a person or your code decides. Read-only tools are allowed without asking; what happens to the rest is up to you.
from shipit_agent import Agent, PermissionEngineagent = Agent.with_builtins( llm=llm, permissions=PermissionEngine( allow=["Bash(pytest *)", "Bash(git diff *)"], deny=["Bash(git push *)", "Read(.env)"],
Tool call
Bash(git push origin main)
Rules
allow, ask, deny
Mode
default, acceptEdits, plan…
Verdict
runs, asks you, or refused
The code is a checked example from the docs; the output is an example of what it prints.
from shipit_agent import Agent, PermissionEngine
agent = Agent.with_builtins(
llm=llm,
permissions=PermissionEngine(
allow=["Bash(pytest *)", "Bash(git diff *)"],
deny=["Bash(git push *)", "Read(.env)"],
ask=["Edit(migrations/**)"],
),
)5 more ways to use it
Each example is from the docs and checked against the library.
The mode sets the default for calls no rule covers.
from shipit_agent import Agent
from shipit_agent.llms import build_llm_from_env
agent = Agent.with_builtins(llm=build_llm_from_env(), permission_mode="acceptEdits")Modes
default, acceptEdits, plan and bypass, from read-only planning to full autonomy.
Rules
Tool name plus a pattern: Bash(git push *), Edit(migrations/**).
Deciding in code
A permission callback approves or refuses each call.
Approving later
Queue a call for approval and resume when someone answers.
| Parameter | Default | What it does |
|---|---|---|
| permission_mode | 'default' | Rule-based gate over tool calls. Set a mode ("default" | "acceptEdits" | "plan" | "bypass"), or pass a full `PermissionEngine` / kwargs dict via `permissions`, or a `permission_callback(name, args) -> PermissionResult | None` for programmatic human-in-the-loop approval. |
| permissions | None | A `PermissionEngine`, a mode name or a dict of its settings. Permissions. |
| permission_callback | None | `(tool_name, arguments) -> PermissionResult | None`, for calls that would ask. |
| allowed_tools | empty | Pre-approved calls, as SDK rules: `"Read"`, `"Bash(npm test *)"`. They approve; they do not restrict the other tools. |
| disallowed_tools | empty | A bare name removes the tool from the run; a scoped rule such as `"Bash(rm *)"` denies matching calls in every permission mode. |
| approvals | None | An `ApprovalQueue` (or `True` for a fresh one). Side-effecting tools the policy marks `ask` are queued instead of blocking the run; you approve later, in bulk. |