Governance configuration: organizational policies for command, file, and content restrictions

Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Feb 18, 2026 · closed Mar 8, 2026

Proposal: Governance Configuration for Claude Code

Summary

Add support for a .claude/governance.yaml configuration file that allows organizations to define policies for what Claude Code can do in a repository — command restrictions, file path protections, content filters, and audit logging.

Motivation

Claude Code is increasingly used in enterprise environments where organizations need governance controls:

  1. Command restrictions — Block dangerous commands (rm -rf /, curl | bash), require approval for others (sudo, docker)
  2. File protections — Prevent modifications to .env, *.key, .git/config, production configs
  3. Content policies — Ensure generated code doesn't contain hardcoded secrets, bypass security checks, or introduce known vulnerable patterns
  4. Audit logging — Log all commands executed and files modified for compliance (SOX, SOC2, HIPAA)

Proposed Configuration

# .claude/governance.yaml
governance:
  level: moderate  # permissive | moderate | strict
  
  commands:
    blocked_patterns: ["rm -rf /", "curl * | bash", "eval("]
    require_approval: ["sudo", "docker", "kubectl"]
    
  files:
    protected: [".env*", "*.key", "*.pem", "secrets/"]
    read_only: ["LICENSE", "CODEOWNERS"]
    
  content:
    block_patterns: ["password=", "api_key=", "AWS_SECRET"]
    require_review: ["eval(", "exec(", "subprocess.call"]
    
  audit:
    enabled: true
    log_path: ".claude/audit.jsonl"

Integration with Existing Features

This would complement:

  • CLAUDE.md — Project instructions (what to do) vs governance (what NOT to do)
  • Permissions system — Current permission model controls tool access; governance adds organizational policy layer
  • Security review action — claude-code-security-review scans PRs; governance prevents issues before they're created

Context

We maintain Agent-OS governance framework. Filed governance proposals across the ecosystem:

View original on GitHub ↗

5 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/21794
  2. https://github.com/anthropics/claude-code/issues/25053
  3. https://github.com/anthropics/claude-code/issues/24501

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

imran-siddique · 7 months ago

This is not a duplicate of the referenced issues. Here's why:

  • #21794 (Web4 governance) — Proposes a cryptographic provenance chain with Merkle audit trails, trust tensors (T3), and a plugin architecture. Our proposal is deliberately simpler: a .claude/governance.yaml config file that organizations can drop into any repo for immediate policy enforcement. Complementary, not overlapping — #21794 is infrastructure, ours is configuration.
  • #25053 (Sensitive env vars/paths) — Focuses specifically on secret redaction (preventing Claude from seeing API_KEY values). Our proposal covers command restrictions (blocked_patterns: ["rm -rf /"]), file write protections (not just read redaction), content generation policies, and audit logging. Secret management is one slice; governance is the full policy layer.
  • #24501 (Automatic governance for architectural rules) — Addresses Claude Code not following loaded CLAUDE.md rules during evaluations. This is about LLM behavior/attention priority. Our proposal is about runtime enforcement — blocking dangerous commands before execution, protecting file paths from modification, and generating compliance audit logs. Completely different mechanism.

TL;DR: #21794 = cryptographic audit infrastructure, #25053 = secret value redaction, #24501 = architectural rule prioritization, ours = declarative security policy configuration (command/file/content restrictions + audit). All four address different aspects of the governance space.

Happy to cross-reference these issues and collaborate with the other authors on a unified governance story if the team is interested.

imran-siddique · 7 months ago

Update: The governance configuration patterns proposed here just got production validation — 3 PRs with the same policy enforcement and threat detection patterns merged into github/awesome-copilot (21.6K stars), reviewed and accepted by GitHub staff (@aaronpowell).

This further demonstrates the need for declarative governance configuration across AI coding agents. The .claude/governance.yaml approach proposed here complements the existing permission model and would bring Claude Code in line with the governance capabilities now available in the Copilot ecosystem.

imran-siddique · 7 months ago

Closing - project moved to microsoft/agent-governance-toolkit. Will re-submit fresh proposals from the Microsoft repo. Thank you!

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.