How permissions work
A permission grants an agent the right to perform one or more actions on a resource. KavachOS evaluates permissions at call time by checking whether any of the agent’s permissions match the requested resource and include the requested action, then verifying all constraints pass.Colon-separated resource path. Wildcards (*) match exactly one segment.
The actions this permission grants. No fixed set, define what fits your tools.
Optional conditions that must all be satisfied for the permission to apply.
Matching rules
Resource pattern matching
Resources follow a colon-separated hierarchy. Theresource field in a permission is matched against the resource in the authorization request using exact matches or wildcards.
mcp:github:* matches mcp:github:repos and mcp:github:issues, but not mcp:github:repos:comments, that is two segments deeper.
Actions
Actions describe what the agent can do to a resource. KavachOS does not enforce a fixed set, you define what makes sense for your tools. Common actions in MCP contexts:| Action | Typical use |
|---|---|
read | Fetching data, listing resources |
write | Creating or modifying resources |
execute | Running tools, shell commands, deployments |
delete | Permanent removal of resources |
actions array, and all constraints satisfied.
Constraints
Constraints add conditions to a permission. All conditions must be met for the permission to apply.Sliding 5-minute window rate limit. Calls beyond this return RATE_LIMIT_EXCEEDED.
Glob-style patterns. The arguments field in the authorization request must match at least one.
When true, the call is denied with APPROVAL_REQUIRED. Your app must handle the approval flow.
HH:MM format, UTC. Calls outside this range are denied.
CIDR ranges. Requests from IPs outside this list are denied.
Rate limiting
Rate limiting
Limits how many times an agent can call a resource per hour. Uses a 5-minute sliding window.Calls beyond the limit return
result: 'rate_limited' in the audit log and allowed: false with reason RATE_LIMIT_EXCEEDED.Argument pattern matching
Argument pattern matching
Restricts what arguments an agent can pass to a tool. Patterns are glob-style strings matched against the If no pattern matches, the call is denied.
arguments field of the authorization request.Human-in-the-loop approval
Human-in-the-loop approval
Prevents automatic authorization. The call is logged and denied until a human approves it through your application’s approval flow.The authorization result has
allowed: false and reason APPROVAL_REQUIRED. Your application is responsible for presenting the approval UI and re-authorizing after approval.KavachOS does not ship an approval UI. It provides the enforcement point. How you build the human review step is up to you.
Time windows
Time windows
Restricts when an action is allowed. Times are in 24-hour format, UTC.Calls outside the window return
allowed: false. Useful for business-hours-only policies or maintenance windows.IP allowlist
IP allowlist
Restricts which source IPs can use the permission. Accepts CIDR notation.Pass the caller’s IP in the authorization request for this to take effect. Requests from IPs outside the list are denied.
Permission templates
KavachOS ships named templates for common patterns. Import them fromkavachos:
| Template | Actions | Resource | Notes |
|---|---|---|---|
readonly | read | * | |
readwrite | read, write | * | |
admin | * | * | All actions on all resources |
mcpBasic | read, execute | mcp:* | |
mcpFull | read, write, execute | mcp:* | |
rateLimitedRead | read | * | 100 calls/hour |
approvalRequired | * | * | Every call requires human approval |
businessHours | read, write, execute | * | 09:00–17:00 UTC |
Permission[] arrays. Spread and extend them directly:
getPermissionTemplate(name) when you need a deep copy rather than a reference to the shared array:
Next steps
Delegation chains
Delegate permission subsets to other agents.
Audit trail
See how permissions are logged on every call.
Compliance
Map permissions to EU AI Act and NIST requirements.