Policies define governance rules that control how tools can be executed. Use policies to enforce rate limits, require approvals, mask sensitive data, and more.Documentation Index
Fetch the complete documentation index at: https://hypha-docs.plinqx.app/llms.txt
Use this file to discover all available pages before exploring further.
What are Policies?
Policies are rules that apply to tool executions. They can:- Require Approvals: Block execution until approved
- Limit Rates: Restrict calls per time window
- Set Quotas: Limit total usage per period
- Mask Fields: Redact sensitive data from responses
- Deny Access: Block specific tools or principals
- Allow Access: Explicitly permit (bypass other rules)
Policy Scopes
Policies can apply at different levels:| Scope | Applies To |
|---|---|
| Global | All tool executions tenant-wide |
| Collection | All tools in a specific Collection |
| Tool | A specific tool only |
| Principal | Requests from a specific Principal |
Creating Policies
Configure Scope
Choose the policy scope:
- Global: Applies to all tools
- Collection: Select a specific Collection
- Tool: Select a specific tool
- Principal: Select a specific Principal
Rule Types
Approval Rules
Require approval before execution:- Auto-approve: Automatically approve (useful for logging)
- Single Approver: Require one approval
- Multi-approver: Require multiple approvals
- Approvers: Select who can approve
Rate Limit Rules
Limit calls per time window:- Window: Per minute, per hour, or per day
- Limit: Maximum calls per window
- Scope: All principals or specific ones
Quota Rules
Limit total usage per period:- Period: Daily or monthly
- Limit: Maximum calls per period
- Scope: All principals or specific ones
Field Masking Rules
Redact sensitive fields:- Input Masking: Hide fields in request logs
- Output Masking: Redact fields from responses
- Fields: List of field paths to mask (JSONPath)
Deny Rules
Block execution entirely:- Condition: Optional condition expression
- Message: Error message to return
Allow Rules
Explicitly permit execution:- Bypass: Bypass other rules
- Condition: Optional condition expression
Policy Evaluation
Policies are evaluated in priority order:- Higher Priority First: Policies with higher priority are evaluated first
- Terminal Decisions: Some rules stop evaluation (DENY, PENDING_APPROVAL)
- Continue Evaluation: Other rules continue (ALLOW, RATE_LIMITED)
Once a terminal decision is reached (DENY, PENDING_APPROVAL), evaluation stops. ALLOW rules can bypass other rules.
Condition Expressions
Policies can include conditions:Best Practices
Start with Global
Create global policies for organization-wide rules
Use Specific Scopes
Use tool/principal scopes for fine-grained control
Set Priorities
Use priorities to control evaluation order
Test Policies
Test policies in Playground before production
Next Steps
Set Up Approvals
Configure approval workflows
View Audit Logs
Monitor policy enforcement