Summary
Design spec for a new Resource Rules Engine — a parameter-level policy system that allows IT admins to restrict which resources (Notion pages, GitHub repos, Slack channels, etc.) agents can access via YAML-based policies.
Key decisions
- IAM/OPA-inspired syntax: named rules with explicit
effect (allow/deny) and typed conditions
- Conflict resolution: Explicit Deny > Explicit Allow > Implicit Deny
- Operators typed by JSON Schema type: string, number, boolean, array — each with their valid operators
- Separate entity from existing
OrgToolkitPolicy (orthogonal concern)
- Proxy enforcement: evaluated pre-upstream in
CallToolRequestSchema handler, fail-closed
- Admin UX: Visual Builder (primary) + YAML view toggle for power users
- Audit:
failureStage: "resource_rule" with sensitive value redaction
Spec covers
- Data model (
ResourceRule, ResourceRuleAssignment with targetType/targetId)
- Evaluation engine algorithm (denylist mode, allowlist mode, mixed mode)
- Proxy integration (where and how rules are loaded, cached, and evaluated)
- Audit trail (block types, redaction, ClickHouse dual-write)
- Admin UI pages and components
- tRPC procedures
- Zod schemas
- File structure
- Testing strategy
No code changes
This PR contains only the design document. Implementation will follow in subsequent PRs.