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
Writing a policy for AI agent configuration
You can 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
