Permissions
Theathena.core.permissions module provides a comprehensive permission system with three core concepts:
- Capability Tokens - Control which operations a caller can perform
- Sensitivity Labels - Classify data flowing through the system
- Secret Mode - Restrict all output to public-only data
Quick Start
Permission Levels
Permission Enum
Sensitivity Classification
Sensitivity Enum
Secret Patterns
Content is auto-classified asSECRET if it matches:
Internal Patterns
Content is auto-classified asINTERNAL if it matches:
Tool Registry
Tools are registered with their required permission level and data sensitivity:Permission Engine
get_permissions()
Returns the singletonPermissionEngine instance.
PermissionEngine Class
Core API
check(tool_name)
Check if the caller has permission to execute a tool.check_sensitivity(tool_name)
Check if tool output is allowed under current sensitivity mode.gate(tool_name, input_str)
Combined gate checking permission, sensitivity, AND granular rules.label(content)
Auto-classify content sensitivity based on pattern matching.redact(content)
Redact secret patterns from content.Mode Control
set_secret_mode(enabled)
Toggle secret/demo mode.set_caller_level(level)
Set the caller’s permission level.Granular Permissions
Action Enum
GranularPermissionEngine
Glob-based permission engine with allow/ask/deny per tool. Origin: OpenCode (anomalyco/opencode, 109K stars)Athena Integration: Feb 2026
Default Rules
GranularRule Matching
Adding Custom Rules
Exceptions
PermissionDenied
SecretModeViolation
Introspection
get_status()
Return current permission state.get_tool_manifest()
Return the full tool permission manifest.Persistence
Permission state is persisted to disk:Audit Log
All permission checks are audited:- Max entries: 1000
- Trimmed to: 500 (when limit exceeded)