Permissions and safety

Security is divided between Cards (which governs metadata, plans, and merge gates) and the agent harness (which governs system access, file modifications, and network requests).

Cards does not sandbox the agent's execution. It relies on a three-tier validation system for metadata and Gated workflows.

The Three Tiers of Cards Validation

Cards protects the integrity of the card repository using three enforcement tiers:

1. API Validation

The Cards server validates the card repository's schema and integrity whenever metadata is written to CARD.meta.json.

2. Git-Hook Validation

A pre-commit hook runs locally before each commit is finalized. It is fail-closed; if any validation fails, the commit is rejected. The hook enforces the following rules:

  • Metadata Integrity: Rejects the commit if CARD.meta.json is malformed.
  • Mermaid Syntax: If a committed .md file contains a Mermaid diagram, Cards validates it and rejects the commit if the diagram is unreachable or its syntax is invalid.
  • Merge Gate Reset: If the commit adds new files to the commits/ directory, the hook automatically resets gates.mergeApproved to false in CARD.meta.json.
  • Plan Gate Reset: If a new plan file is added under the plans/ directory, the hook automatically resets gates.planApproved to false in CARD.meta.json.

3. Skill Convention

Convention-level rules govern how agents interact with the project workspace, such as using temporary branches or sharing worktrees.

Harness-Level Permissions

The agent harness (e.g., Claude Code or Codex) is responsible for sandboxing and executing commands.

Because the harness runs as a subprocess under your local user account, it has the same system access as your shell. You must configure file-system boundaries, network allowlists, and command-approval prompts directly in the harness configuration (for Claude Code, in .claude/settings.json or ~/.claude/settings.json).

Limitations

Caution: Bypassing the Git hooks (e.g., via git commit --no-verify or setting CARDS_SKIP_HOOK=1) will allow unvalidated metadata or invalid Mermaid syntax into the repository. This can break the Cards UI and cause the server to reject subsequent sync operations.