scope-guard
v0.1.3Hard scope boundaries to prevent AI agent drift
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
create_scope_contract
Define an agent's scope boundaries: allowed/forbidden tools, file access paths, and delegation limits.
| Parameter | Type | Description |
|---|---|---|
agent_id * | string | Unique identifier for the agent |
allowed_files * | array | File path patterns the agent can access. Supports glob-like prefixes (e.g. "src/lib/*"). Empty array means all files allowed. |
allowed_tools * | array | List of tools the agent is permitted to use. Empty array means all tools allowed. |
description * | string | Human-readable description of what this agent is responsible for |
forbidden_tools * | array | List of tools the agent is explicitly forbidden from using. Takes priority over allowed_tools. |
max_delegations | integer | Maximum number of delegations this agent can make before being told to execute directly (default 3) |
validate_action
Check if a proposed action (tool call, file access) is within an agent's scope contract. Call this BEFORE the agent executes.
| Parameter | Type | Description |
|---|---|---|
agent_id * | string | Agent identifier to validate against |
tool_name * | string | Name of the tool the agent wants to call |
file_path | string | File path the agent wants to access (optional) |
detect_delegation_loop
Check a delegation chain for circular patterns. Detects when agents delegate back to each other creating infinite loops.
| Parameter | Type | Description |
|---|---|---|
delegation_chain * | array | Ordered list of delegation steps to analyze |
log_agent_action
Track what an agent is doing. Logs tool calls, delegations, file accesses, and completions for compliance monitoring and duplication detection.
| Parameter | Type | Description |
|---|---|---|
action_type * | string | Type of action being performed |
agent_id * | string | Agent identifier |
details * | object | Action details — for tool_call: {tool_name, args, file_path}; for delegation: {to, task}; for file_access: {file_path, operation}; for completion: {result} |
get_compliance_report
Get a compliance summary for all agents: total actions, scope violations, delegation counts, and scope utilization percentage.
detect_work_duplication
Find agents doing the same work. Compares action logs across all agents — if 2+ agents called the same tool with similar arguments, flags as potential duplication.