Skip to content

hardening: apply forbid policies from the user's files - #72

Draft
sorah wants to merge 3 commits into
hardening/tool-detectionfrom
hardening/user-policy
Draft

sorah wants to merge 3 commits into
hardening/tool-detectionfrom
hardening/user-policy

Conversation

@sorah

@sorah sorah commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Implements docs/specs/011-user-policy.md.

  • the agent reads ~/.config/mairu/policy.cedar and authorization.json itself before each decision (reload on (dev, ino, mtime, size) change, else every 5 s)
  • unapproved files can only tighten: their strictly validated forbid policies join the built-ins; every permit is ignored; broken files, templates, duplicate or builtin- ids are dropped with notes. Approval comes in the next layer (012)
  • authorization.json: tool_detection additions and a shorter grant_retention_secs apply while unapproved; methods, sts and network are validated but ignored
  • GetPolicy RPC; mairu policy init|check|show|explain|schema; doctor gains a policy line

Verified in Docker (56 checks): forbids refuse with REASON_FORBIDDEN and their id without prompting or fetching, gate-2 forbids by real account, ignored permits, broken files, edits picked up by the next request.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM

sorah and others added 2 commits October 31, 2026 10:03
The agent reads policy.cedar and authorization.json from the config
directory itself. Nothing records an approval yet, so only the forbid
policies and settings that tighten apply; permits, methods, sts and
network are ignored and reported through GetPolicy notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM
@sorah
sorah added this pull request to stack #63 October 31, 2026 01:04
@sorah sorah changed the title hardening/user policy hardening: apply forbid policies from the user's files Oct 31, 2026
50 ms elapsed between two loads on CI runners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dg17LE9aWqsb1VBUCVcKLM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant