Policy Enforcement Rule Reference
All rule IDs emitted by PolicyEnforcer across the 6 enforcement categories. Each rule produces a PolicyViolationError (or a warning in override mode) with the listed message pattern.
Network Rules
Enforced by enforceNetwork(domain, protocol).
| Rule ID | Trigger | Message |
|---|---|---|
network.missing | No permissions.network in policy | Network permissions not configured |
network.disabled | network.enabled is false | Network access is disabled |
network.tls_required | require_tls is true and protocol is not https | TLS is required for network requests |
network.blocked | Domain matches a blocked_domains pattern | Domain <domain> is blocked by policy |
network.not_allowed | Domain does not match any allowed_domains pattern | Domain <domain> is not in the allowlist |
Domain matching rules:
"*"matches any domain"*.example.com"matchesexample.comand all subdomains (e.g.api.example.com,deep.nested.example.com)"api.openai.com"matches exactly that domain
Filesystem Rules
Enforced by enforceFilesystem(path, operation).
| Rule ID | Trigger | Message |
|---|---|---|
fs.missing | No permissions.filesystem in policy | Filesystem permissions not configured |
fs.disabled | filesystem.enabled is false | Filesystem access is disabled |
fs.blocked | Path matches a blocked_paths pattern | Path <path> is blocked |
fs.not_allowed | Path does not match any allowed_paths pattern | Path <path> is not in the allowlist |
fs.ext | File extension is not in allowed_extensions | Extension <ext> is not allowed |
Path matching rules:
"/tmp/*"matches/tmp/and everything under it"/workspace/data.json"matches exactly that path- Blocked paths are checked before allowed paths
Tool Rules
Enforced by enforceTool(toolName).
| Rule ID | Trigger | Message |
|---|---|---|
tool.blocked | Tool name is in blocked_tools | Tool <name> is blocked |
tool.not_allowed | Tool name does not match any allowed_tools entry | Tool <name> is not in the allowlist |
Tool matching patterns:
| Pattern | Example | Matches |
|---|---|---|
| Exact name | "calculator" | Only calculator |
| Wildcard | "file_*" | file_read, file_write, file_delete, etc. |
| Category all | "files:*" | All tools with the file_ prefix |
| Category ops | "files:[read,write]" | file_read and file_write only |
Built-in category prefixes:
| Category | Prefix | Example tools |
|---|---|---|
files | file_ | file_read, file_write, file_delete |
directories | dir_ | dir_list, dir_create, dir_delete |
network | http_ | http_request, http_get |
data | json_ | json_parse, json_query |
system | env_ | env_get, env_set |
If no allowed_tools list is configured, all tools are permitted (unless explicitly blocked).
Model Rules
Enforced by enforceModel(model).
| Rule ID | Trigger | Message |
|---|---|---|
model.not_allowed | Model is not in allowed_models | Model <model> is not allowed |
model.blocked | Model is in blocked_models | Model <model> is blocked |
If no allowed_models list is configured, all models are permitted. Blocked models are checked even when no allowlist exists.
API Rules
Enforced by enforceApi(service).
| Rule ID | Trigger | Message |
|---|---|---|
api.missing | No permissions.api in policy | API permissions not configured |
api.disabled | api.enabled is false | API access is disabled |
api.not_allowed | Service is not in allowed_services | API service <service> is not in the allowlist |
Rate Limit Rules
Enforced by enforceRateLimit(type, count).
| Rule ID | Trigger | Message |
|---|---|---|
rate_limit.exceeded | Count exceeds configured limit within window | Rate limit exceeded: <key> (<count>/<limit>) |
Configurable limits:
| Config Key | Window | Type |
|---|---|---|
requests_per_minute | 60 seconds | request |
requests_per_hour | 3600 seconds | request |
tokens_per_minute | 60 seconds | token |
Rate limits use sliding windows. Windows are reset when the window duration elapses.
Override Mode
All rules support override (warn-only) mode. When enabled:
- Violations are logged to
console.warninstead of throwing - The
onViolationcallback fires with the rule ID and message - Execution continues normally
Enable override mode via:
- Constructor parameter:
new PolicyEnforcer(policy, true) - Environment variable:
SEKUIRE_POLICY_DEV_OVERRIDE=true
Next Steps
- OAGS Specification - Full governance specification
- Policy Syntax - Policy JSON schema
- SDK Policy Enforcement - SDK integration guide