Overview
Chainloop can automatically collect AI agent configuration files during the attestation process. This creates aCHAINLOOP_AI_AGENT_CONFIG material that captures how agentic development tools are configured in your project, providing visibility and policy enforcement over AI tool usage in your software delivery lifecycle.
The collector currently supports Claude configuration files, with support for additional AI agents planned for future releases.
How it works
When you pass the--collectors aiagent flag to chainloop attestation init, the CLI scans your project for known AI agent configuration files. The discovered files are bundled into a single CHAINLOOP_AI_AGENT_CONFIG material and automatically included in the attestation (no manual attestation add step is required).
The collected material includes metadata about the agent, a hash of the overall configuration, timestamps, and details about each discovered file.
Collected files
Theaiagent collector currently looks for the following Claude configuration file patterns:
| Pattern | Description |
|---|---|
CLAUDE.md | Project-level instructions |
.claude/CLAUDE.md | Claude directory instructions |
.claude/settings.json | Claude settings |
.mcp.json | MCP server configuration |
.claude/rules/*.md | Custom rules |
.claude/agents/*.md | Agent definitions |
.claude/commands/*.md | Custom commands |
.claude/skills/*/SKILL.md | Skill definitions |
Support for additional AI agents beyond Claude will be added in future releases.
Material schema
TheCHAINLOOP_AI_AGENT_CONFIG material follows this structure:
Enabling the collector
Initialize the attestation with the collector
Pass the The CLI will scan for AI agent configuration files and report what it found.
--collectors aiagent flag during attestation initialization:Contract example
While the collector automatically attaches the material, definingCHAINLOOP_AI_AGENT_CONFIG in your contract allows you to attach policies to it:
contract.yaml
Built-in policies
Chainloop ships with built-in policies for AI agent configuration governance. Attach them to your contract to start enforcing best practices immediately — no custom Rego required:| Policy | What it checks |
|---|---|
ai-agent-present | Detect AI agent presence via configuration materials or bot reviewers on PRs |
ai-config-mcp-servers-allowed | Ensure only approved MCP integrations are configured |
ai-config-architecture-with-paths | Verify instruction files describe project architecture |
ai-config-code-style-specificity | Require concrete, project-specific code style rules |
ai-config-skill-descriptions-actionable | Ensure skills describe what they do and when to use them |
ai-config-subagent-descriptions-actionable | Require subagent descriptions with trigger, scope, and purpose |
ai-instructions-commands-documented | Require exact, executable commands instead of vague instructions |
ai-instructions-size-bounds | Enforce line count limits on instruction and skill files |
ai-instructions-verification-criteria | Require verification mechanisms like tests or expected outputs |
Writing a custom policy
You can also write custom Rego policies to enforce rules on the collected AI configuration. The following example checks that the agent name isclaude and produces a violation otherwise.
check-agent-name.yaml
valid_inputchecks that the material contains anagent.namefield, skipping evaluation if the schema is unexpected.- The
violationsrule fires whenagent.nameis anything other than"claude", producing a descriptive error message.
Testing the policy locally
Use the policy development CLI tools to validate your policy before deploying it:Related resources
- Material Types — Full list of supported material types
- How to write custom policies — In-depth guide on writing and testing Rego policies
- Policies concept — How policies work in Chainloop
