Allowlists
Bash allowlists control what shell commands agents can execute. Each rule matches a command string with a shell-glob pattern and assigns one of three dispositions:
Rules are evaluated in priority order: deny rules win first, then ask, then allow. Anything not matched by any rule falls through to the org-level default policy (which itself can be
allow, ask, or deny).
Examples
How enforcement works
When a session boots, Runtime installs a Claude CodePreToolUse hook that intercepts every bash command before execution. The hook evaluates the command against the org’s allowlist rules and either permits, blocks, or pauses for approval. This works at the VM level, not the application layer, so agents cannot bypass it.
Rules can be scoped to all repos or specific ones, and personal or team scope.
API endpoints
Allowlist rules usetype=allowlist_rule_v0. See the Skills API reference.
Hooks
Hooks are event-driven scripts that fire at specific points in the agent lifecycle. They let you run custom logic before or after tool calls, when prompts are submitted, when sessions start or end, and more.Supported events
Tool-scoped hooks
ForPreToolUse and PostToolUse, you can narrow the hook to fire only for specific tools:
Bash- shell commandsRead/Write/Edit- file operationsWebFetch- HTTP requestsTodoWrite- task list operations
What hooks can do
Each hook defines a command (a bash script) that runs when the event fires. The script receives context about the event and can:- Log the event for audit purposes
- Block the action (for
PreToolUsehooks) - Modify the environment before the action proceeds
- Notify external systems (post to Slack, update a dashboard, etc.)
Scoping
Hooks can be scoped to personal or team, and attached to all repos or specific ones. Like other directives, each hook has exactly one live version; lock it to freeze edits.API endpoints
Hooks usetype=hook_v0. See the Skills API reference.
Network
Network rules restrict which hosts and IP ranges the sandbox can reach on the network. This is enforced at the VM level, not the application layer, so agents cannot bypass it.Rule types
Default behavior
By default, sandboxes have outbound access to the public internet (package registries, APIs, etc.). Network rules let you lock that down:- Allowlist mode - only explicitly listed hosts and CIDRs are reachable
- Denylist mode - everything is reachable except explicitly blocked hosts
- Your org handles sensitive data and agents should only reach approved API hosts
- You want to prevent agents from contacting arbitrary external services
- Compliance requires restricting egress to a known set of endpoints
API endpoints
Network rules usetype=network_rule_v0. See the Skills API reference.
Approvals
Approvals add human-in-the-loop gates for sensitive operations. When an action requires approval, the agent pauses and waits for a team member to review and approve before proceeding. Approval workflows can be configured for:- Production deploys - require admin sign-off before shipping to production
- Sensitive commands - flag specific bash patterns for manual review (via allowlist
askrules) - Plan mode - agents generate a plan first and wait for approval before executing
RBAC
Role-based access control defines what each role in the organization can do:
RBAC applies across every surface: dashboard, CLI, and API. API keys cannot exceed their owner’s role ceiling, even if the scope is requested. See Scopes for the full matrix.
Per-user controls
Beyond roles, admins can set per-user limits:- Maximum concurrent sessions
- Monthly spend budgets
- Model restrictions (which LLMs the user’s agents can call)
- Deploy target restrictions (staging only, specific apps only)
Audit
Audit trails record every action taken by agents and users in the organization. Every prompt, file change, command, deploy, and cost event is captured with:- Who - user id, email, role
- What - prompt text, files changed, commands run, tools called
- When - UTC timestamp
- How much - tokens consumed, dollars spent, compute time
- Where - session id, template, agent type
What gets logged
- Every prompt submitted
- Every tool call (bash, file read/write, search, etc.)
- Every file created, modified, or deleted
- Every git operation (clone, commit, push, PR)
- Every deploy (start, success, failure)
- Every session lifecycle event (create, pause, resume, destroy)
- Every API key creation, revocation, and usage
- Every guardrail enforcement (blocked command, hook fired, network rule hit)
Accessing audit data
- Dashboard - the Activity tab shows a real-time stream of events
- API - Team Events returns structured event data for export
- Metrics - Team Summary aggregates events into time-series data
Putting it all together
A typical org configuration:- Allowlists - prevent destructive commands, gate production pushes, allow package installs
- Hooks - log every tool call to your SIEM, block writes to protected config files
- Network - restrict to package registries plus approved API hosts
- Approvals - require admin sign-off for production deploys
- RBAC - members can create sessions and deploy to staging; admins manage templates and secrets
- Audit - weekly review by the security team, events exported to your data warehouse
Related guides
Best practices
Key hygiene, scope selection, and cost control patterns.
Teach the agent your codebase
AGENTS.md, skills, and org instructions.