Loading…
Loading…
Features · Control · Secure by default
An agent reads content it does not control, so shipit assumes that content may try to steer it. Tools ask before they act, URL tools cannot reach your network, file tools stay in the project, and secrets are scrubbed before traces leave.
from shipit_agent.sdk import AgentOptions, queryoptions = AgentOptions( model="claude-sonnet-5-5", allowed_tools=["Read", "Grep", "Bash(pytest *)"], # pre-approved disallowed_tools=["Bash(rm *)", "Read(~/.ssh/**)"], # refused in every mode)
Untrusted content
a page, a file, an MCP result
Model
asks for a tool call
Checks
rules, address, path, key
Only what you allowed
runs, and is recorded
Watch one run, a moment at a time.
Each step lights up as the lines it produces appear. Pause it, or step through it yourself.
0 of 8 · Untrusted content
Untrusted content
a page, a file, an MCP result
Model
asks for a tool call
Checks
rules, address, path, key
Only what you allowed
runs, and is recorded
The code is a checked example from the docs; the output is an example of what it prints.
from shipit_agent.sdk import AgentOptions, query
options = AgentOptions(
model="claude-sonnet-5-5",
allowed_tools=["Read", "Grep", "Bash(pytest *)"], # pre-approved
disallowed_tools=["Bash(rm *)", "Read(~/.ssh/**)"], # refused in every mode
)
async for message in query(prompt="Run the tests and fix what fails.", options=options):
print(message)5 more ways to use it
Each example is from the docs and checked against the library.
With the SDK API, a tool that no rule allows does not run. Reads and searches are free; everything else is named in allowed_tools, approved by a mode, or decided by can_use_tool.
from shipit_agent.sdk import AgentOptions, PermissionResultAllow, PermissionResultDeny, query
async def can_use_tool(tool_name, tool_input, context):
if tool_name == "bash" and "deploy" in tool_input.get("command", ""):
return PermissionResultDeny(message="No deploys from the agent.")
return PermissionResultAllow()
options = AgentOptions(
model="claude-sonnet-5-5",
allowed_tools=["Read", "Grep", "Bash(pytest *)"], # pre-approved
disallowed_tools=["Bash(rm *)", "Read(~/.ssh/**)"], # refused in every mode
can_use_tool=can_use_tool, # everything else
)
async for message in query(prompt="Run the tests and fix what fails.", options=options):
print(message)Ask before acting
SDK agents run reads freely; any other tool needs a rule, a mode or your approval.
No way into your network
URL and browser tools refuse private, loopback and metadata addresses, on every redirect.
Files stay in the project
Reads, writes, downloads and PDFs are held to the project root.
Nothing secret leaves
Wrap a trace exporter and keys and personal data are scrubbed before events are sent.
| 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. |
| 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. |
| permission_callback | None | `(tool_name, arguments) -> PermissionResult | None`, for calls that would ask. |
| guardrails | None | A `Guardrails` instance: blocks prompt-injection inputs, redacts secrets/PII from outputs, and denies tool calls whose arguments match configured patterns. See `shipit_agent.guardrails`. |
| lockdown | None | Once a tool reports it returned sensitive data, the run may only make observations — every action is denied for the rest of the run, so the data cannot leave through another tool. Honours declarations by default and detects nothing; pass a LockdownPolicy to add detection, or False to disable. |