SPDX-License-Identifier: CC-BY-SA-4.0
|
Important
|
IF YOU ARE AN AI AGENT: Read 0-AI-MANIFEST.a2ml FIRST before doing anything else in this repository. |
The AI Gatekeeper Protocol is a standardized system that ensures AI agents (Claude, Gemini, OpenAI, Mistral, etc.) read and understand repository structure before performing operations.
-
AI agents lose context between sessions
-
Different platforms (Claude, Gemini, Copilot) make the same mistakes
-
Users waste time re-explaining architectural decisions
-
Duplicate files get created despite explicit instructions
-
No mechanical enforcement of repository invariants
Every repository contains a manifest file (0-AI-MANIFEST.a2ml) that:
-
✅ Declares canonical file locations (e.g., "SCM files ONLY in `.machine_readable/`")
-
✅ States critical invariants that must never be violated
-
✅ Provides attestation mechanism (AI must prove it read the manifest)
-
✅ Works across all AI platforms (platform-agnostic)
-
✅ Enables mechanical enforcement (MCP server, FUSE wrapper, CI/CD)
-
Read
0-AI-MANIFEST.a2ml(orAI.a2ml) in repository root -
Understand canonical locations and invariants
-
If using MCP: Call
acknowledge_manifestwith manifest hash -
Proceed with operations following manifest rules
cd your-repo
curl -O https://raw.githubusercontent.com/hyperpolymath/0-ai-gatekeeper-protocol/main/examples/0-AI-MANIFEST.a2ml
# Edit to match your repo structure
git add 0-AI-MANIFEST.a2ml
git commit -m "docs: add AI manifest"Add to ~/.claude/config.json:
{
"mcpServers": {
"repo-guardian": {
"command": "node",
"args": ["~/Documents/hyperpolymath-repos/mcp-repo-guardian/dist/index.js"],
"env": {
"REPOS_PATH": "~/Documents/hyperpolymath-repos"
}
}
}
}Universal entry point that ALL AI agents must read first.
-
Declares canonical locations
-
States invariants
-
Provides checksums for attestation
-
Platform-agnostic (plain text)
See: Example Manifest
Provides hard enforcement for MCP-compatible agents (Claude, etc.):
-
Blocks ALL file operations until manifest acknowledged
-
Validates attestation hash
-
Enforces path restrictions
-
Session-based access control
OS-level enforcement for ANY tool/agent:
-
Mounts repos through virtual filesystem
-
Intercepts all file access
-
Universal (works with Gemini, OpenAI, Copilot, etc.)
Repository: https://github.com/hyperpolymath/repo-guardian-fs (coming soon)
GitHub Actions that validate:
-
Manifest exists and is valid
-
Invariants not violated
-
No duplicate files in wrong locations
-
All commits follow protocol
See: Example Workflows
-
RATIONALE.md - Why this system exists
-
ARCHITECTURE.md - Technical design
-
INTEGRATION.md - Platform-specific integration guides
-
ENFORCEMENT.md - Enforcement mechanisms
-
AI-MANIFEST-SPEC.adoc - Formal RFC-style specification
-
FEEDBACK-TO-ANTHROPIC.md - Proposed improvements for Claude
-
Manifest Template - Template for new repos
-
Claude MCP Config - MCP server configuration
-
GitHub Workflows - CI/CD validation
-
No repeated explanations across sessions
-
No repeated explanations across AI platforms
-
Architectural decisions preserved mechanically
-
Reduced frustration, increased productivity
-
Clear instructions on repository structure
-
Context preserved across sessions
-
Reduced mistakes
-
Better cross-platform collaboration
User works with:
-
Claude on laptop (Monday-Wednesday)
-
Gemini on phone (Thursday)
-
GitHub Copilot in IDE (Friday)
Without protocol: Each agent makes same mistakes, creates duplicate files.
With protocol: All agents read manifest first, follow same rules.
Claude crashes mid-session. Context lost.
Without protocol: New session starts fresh, user re-explains everything.
With protocol: New session reads manifest, understands immediately.
-
Add
0-AI-MANIFEST.a2mlto repo root -
Define canonical locations and invariants
-
Optional: Enable MCP enforcement
-
Optional: Add CI/CD validation
-
Add manifest to all repos (use template)
-
Deploy MCP server for Claude users
-
Enable CI/CD validation organization-wide
-
Train team on protocol
Current Version: 1.0.0 (2026-02-07)
-
✅ Manifest format designed
-
✅ MCP server implemented (
mcp-repo-guardian) -
⏳ FUSE wrapper in development (
repo-guardian-fs) -
⏳ Formal specification being written
-
⏳ CI/CD workflows being standardized
-
⏳ Platform integrations being explored
See CONTRIBUTING.md
-
mcp-repo-guardian - MCP enforcement server
-
repo-guardian-fs - FUSE wrapper
-
rsr-template-repo - Repo template with manifest
|
Important
|
AI Agents: After reading this README, proceed to 0-AI-MANIFEST.a2ml for critical repository-specific information. |