AI Context Protocol (ACP)

> Embed machine-readable context directly in your codebase so AI coding assistants understand your code's structure, constraints, and intent.

Embed machine-readable context directly in your codebase so AI coding assistants understand your code's structure, constraints, and intent.


The Problem

AI coding assistants are powerful, but they don't understand your codebase:

  • They don't know which files are frozen in production and must never be modified
  • They can't see your domain boundaries or architectural layers
  • They miss the "tribal knowledge" that lives in your team's heads
  • They treat every line of code the same, regardless of criticality

The result? AI assistants suggest changes to code they shouldn't touch, miss important context, and require constant correction.


The Solution

ACP provides a simple, standard way to annotate your code with machine-readable context that AI assistants can consume:

// @acp:domain auth - Authentication and authorization
// @acp:lock frozen - Critical security code, DO NOT modify
// @acp:owner security-team - Contact before changes
 
export class SessionValidator {
  // @acp:fn "Validates JWT tokens - security critical"
  validateToken(token: string): boolean {
    // ...
  }
}

Run acp index to generate a cache file that any AI tool can read:

$ acp index
 Indexed 247 files
 Found 1,842 symbols  
 Detected 12 domains
 Generated .acp.cache.json

Now your AI assistant knows:

  • Which code is frozen and why
  • How your codebase is organized into domains
  • Who owns what and who to ask
  • What each function does at a glance

Quick Links

Get Started

Understand ACP

How-To Guides

Reference

Tooling


Key Features

FeatureDescription
ConstraintsMark code as frozen, restricted, or approval-required
DomainsOrganize code by business domain (auth, payments, users)
LayersDefine architectural layers (api, service, data)
OwnershipSpecify team ownership for accountability
VariablesToken-efficient references that expand to full context
Call GraphsUnderstand what calls what across your codebase

How It Works

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   Your Code     │     │   ACP CLI       │     │   AI Tools      │
│                 │     │                 │     │                 │
│  @acp:domain X  │────▶│  acp index      │────▶│  Read cache     │
│  @acp:lock Y    │     │                 │     │  Respect rules  │
│  @acp:summary Z │     │  .acp.cache.json│     │  Better context │
└─────────────────┘     └─────────────────┘     └─────────────────┘
  1. Annotate — Add @acp: annotations in your code comments
  2. Index — Run acp index to generate the cache
  3. Integrate — AI tools read the cache and respect your constraints

Supported Languages

ACP works with any language that has comments. Built-in parsing support for:

LanguageExtensionsParser
TypeScript.ts, .tsxtree-sitter
JavaScript.js, .jsx, .mjstree-sitter
Python.pytree-sitter
Rust.rstree-sitter
Go.gotree-sitter
Java.javatree-sitter

Other languages work with comment-based annotations (no AST parsing).


Conformance Levels

Implementations can claim different levels of ACP conformance:

LevelNameCapabilities
1ReaderParse cache files, respect constraints
2StandardLevel 1 + CLI, cache generation
3FullLevel 2 + MCP server, real-time sync

Community & Resources


License

ACP is an open specification released under the MIT License. Implementations may have their own licenses.


ACP Version 1.0.0 | Last Updated: December 2025