AGENTS.md · diff
git:20260615.3ce8f2a to git:20260903.117f195
22 added, 34 removed. Audit B to B.
# AGENTS.md — AI Repo Safety Rules
- This repository uses AI Repo Safety guardrails. Follow these rules before coding, committing, pushing, creating public issues/PRs, or reading GitHub context.
-
- ## Mandatory workflow
-
- 1. Before feature work, ensure `.gitignore`, `.env.example`, `.pre-commit-config.yaml`, `.repo-safety.json`, and `scripts/security/*` exist.
- 2. Before commit, run `pre-commit run --all-files` or `ai-repo-safety scan --target .`.
- 3. Before push, run `ai-repo-safety prepush --target .`.
- 4. Before making the repo public, creating a public issue/PR, or publishing logs, run the release verifier checklist in `assets/agents/release-verifier.md` if available.
- 5. If any secret is found, stop feature work and follow `docs/incident-cleanup.md`.
+ This repository uses AI Repo Safety git hooks as the fail-closed gates.
## Forbidden files to read, print, summarize, upload, or commit
Do not read or print these files unless the user explicitly confirms the security risk:
- `.env`, `.env.*`
- `*.pem`, `*.key`, `*.p12`, `*.pfx`
- `id_rsa`, `id_ed25519`
- `credentials*.json`, `service-account*.json`
- `token.json`, `tokens.json`, `secrets.json`
- `.mcp.json`, `claude_desktop_config.json`
- `*.ovpn`
## Forbidden actions without explicit confirmation
- - `git push`
+ - `git push` / pushing a tag
- making a repository public
- creating public issues or PRs with private context
- uploading logs, screenshots, exports, support tickets, DB dumps, Jira/Confluence exports
- running `env`, `printenv`, `set`, `cat .env`, `type .env`, `Get-Content .env`
- adding or changing MCP servers
- disabling auth, RLS, CORS, input validation, TLS checks, or security scans just to make code work
- installing unknown packages suggested only by model memory
## GitHub context reads
- Do not directly use `gh api`, `gh pr view`, `gh issue view`, or raw GitHub web pages for commits, PRs, branches, or issues when the content will enter the AI context.
-
- Use the guard instead:
+ Do not paste raw GitHub issue/PR/commit bodies into AI context. Use:
- ```bash
- ai-repo-safety github-guard read --repo owner/repo --resource pulls --reason "review current PRs"
- ai-repo-safety github-guard read --repo owner/repo --resource issues --reason "triage issues"
- ai-repo-safety github-guard read --repo owner/repo --resource branches --reason "check branch names"
- ai-repo-safety github-guard read --repo owner/repo --resource commits --reason "review recent commits"
+ ```text
+ python -m ai_repo_safety gate --when github-read --repo owner/repo --resource pulls --reason "review current PRs"
```
- The guard enforces allowed repos, limits, secret redaction, and prompt-injection detection.
+ ## Git gates
- ## Dependency policy
+ Commit, push, and tag are enforced by git hooks. If hooks are missing and you are about to commit or push:
- Before adding a dependency:
+ ```text
+ python -m ai_repo_safety gate --when commit --target .
+ python -m ai_repo_safety gate --when push --target .
+ python -m ai_repo_safety gate --when tag --target .
+ ```
- 1. Verify the package exists and is maintained.
- 2. Prefer standard library or already-present dependencies.
- 3. Run `pip-audit` / `osv-scanner` where applicable.
- 4. Do not install hallucinated packages.
+ # >>> AI REPO SAFETY RULES >>>
+ ## AI Repo Safety Addendum
- ## Missing tools
+ Do not read, print, or commit denylisted secret files (`.env`, keys, credentials JSON, `.mcp.json`, `*.ovpn`).
- If Git, Python, uv, uvx, scanners, or GitHub CLI are missing:
+ Do not `git push`, push a tag, or open a public PR unless the user asked.
- 1. Run `ai-repo-safety doctor --agent-plan`.
- 2. Search official documentation or official releases for the current stable compatible version.
- 3. Install only from official sources or trusted OS package managers.
- 4. Re-run `ai-repo-safety doctor`.
- # >>> AI REPO SAFETY RULES >>>
- ## AI Repo Safety Addendum
+ Do not paste raw GitHub issue/PR/commit bodies into context. Use:
- Run `ai-repo-safety scan --target .` before commits and `ai-repo-safety prepush --target .` before pushes. Use `ai-repo-safety github-guard` for reading GitHub issues, PRs, commits, and branches into AI context.
+ ```text
+ python -m ai_repo_safety gate --when github-read --repo owner/repo --resource pulls --reason "review current PRs"
+ ```
+
+ Commit, push, and tag are enforced by git hooks. If hooks are missing and you are about to commit or push, run `python -m ai_repo_safety gate --when commit|push|tag --target .` first.
# <<< AI REPO SAFETY RULES <<<