What is AGENTS.md?
AGENTS.md is a machine-readable markdown file that describes what an AI agent can do with a repository. It’s like a README for machines — where README tells humans how to use your code, AGENTS.md tells autonomous agents what capabilities your code exposes. Think of it as a contract between your repository and any AI system that wants to interact with it.AGENTS.md follows the Agent-Accessible Interface Format (AAIF) standard, making repositories universally discoverable by autonomous agents.
Why AGENTS.md Matters
Without AGENTS.md, AI agents can’t reliably discover or use your repository’s capabilities. They’re left guessing from code comments and documentation written for humans. With AGENTS.md:- Agents discover your capabilities automatically — no manual configuration needed
- Capabilities are described in structured JSON schemas — reducing hallucination and errors
- Endpoints are documented with precise parameters — agents know exactly how to call your API
- Authentication requirements are explicit — agents can properly authenticate requests
Anatomy of AGENTS.md
Here’s the structure Beacon generates:- Example 1
- Example 2
Endpoints
GET /path
Endpoint description goes here.
| Parameter | Type | Required | Description |
|---|---|---|---|
param | string | ✅ | Parameter description |
Rate Limits
- Per minute: 60
- Per day: 10000
beacon generate ./my-projectbeacon generate https://github.com/user/repo --provider openai --api-key sk-...
What Makes a Good AGENTS.md?
Beacon’s AI inference engine looks for:Clear Capability Descriptions
Clear Capability Descriptions
Capabilities should describe what an agent can accomplish, not how the code works internally.Good: “Scans a repository and generates an AGENTS.md file describing its capabilities”Bad: “Calls the scanner module, then the inferrer, then writes a file”
Precise Input/Output Schemas
Precise Input/Output Schemas
Use JSON Schema to define exactly what data agents need to provide and what they’ll receive back.This eliminates ambiguity and helps agents construct valid requests.
Concrete Examples
Concrete Examples
Examples show agents the exact syntax for using your capabilities.Include both simple and complex use cases when applicable.
Explicit Authentication
Explicit Authentication
Be crystal clear about how agents should authenticate:
none— no authentication requiredbearer— requires Bearer token in Authorization headerapi_key— requires API key (specify where: header, query param, etc.)
Key Sections Explained
Capabilities vs Endpoints
Capabilities describe high-level actions agents can perform. They might map to:- CLI commands (
beacon generate) - API endpoints (
POST /generate) - Library functions
- Background services
Authentication Section
Defined insrc/models.rs:47:
- What type of auth is required (
bearer,api_key,none) - How to use it (in the description field)
Rate Limits
Defined insrc/models.rs:53:
src/main.rs:37).
How Beacon Generates AGENTS.md
The generation happens in three phases (detailed in How It Works):- Scan — Beacon reads your README, source files, package manifests, and OpenAPI specs (
src/scanner.rs) - Infer — An AI model analyzes the context and identifies capabilities, endpoints, and schemas (
src/inferrer.rs) - Generate — Beacon renders the structured data into the AGENTS.md format (
src/generator.rs)
src/generator.rs:12 transforms the internal AgentsManifest struct into markdown:
Schema Validation
Beacon includes a validator that checks AGENTS.md files against the specification. From the CLI:- Required sections are present
- JSON schemas are valid
- Endpoints follow the correct format
- (Optionally) declared endpoints are actually reachable
Beyond the Spec
While AGENTS.md follows the AAIF standard, Beacon’s implementation is opinionated about what makes repositories truly agent-ready:Server-Side Capabilities
Beacon specifically looks for REST APIs, background services, and server-side endpoints — not just utility scripts.
Structured Schemas
Always includes JSON schemas for inputs and outputs when possible, reducing agent errors.
Concrete Examples
Generates real usage examples from your CLI commands or API patterns.
Provider Agnostic
Works with any AI provider, so agents aren’t locked into a specific LLM ecosystem.
Next Steps
How It Works
Dive into Beacon’s three-phase architecture
Generate Your First AGENTS.md
Create an AGENTS.md for your repository
AI Providers
Choose the right AI provider for your needs
AAIF Specification
Read the full AAIF standard