# agentdiet-code-security

> agentdiet-code-security is a paid API for AI agents from agentdiet.dev, paid per call via x402 or MPP, $0.01/call, status unknown (last checked 2026-10-20).

Audits a GitHub repository for license risk, dependency supply-chain security, maintenance velocity, and community health metrics before code execution.

## Facts

- Endpoint: GET https://agentdiet.dev/v1/code-security?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402, MPP
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-code-security-1bafb1b2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_idQGxXKDCm9v7joNDzCZR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agentdiet-code-security-1bafb1b2
```

Example prompt: Before I add the 'langchain-ai/langchain' GitHub repo as a dependency, can you audit it for license risks, supply-chain vulnerabilities, and check how actively maintained it is?

## When to prefer this

Choose this endpoint when an AI coding agent needs to vet a third-party GitHub repository for security, license compliance, or maintenance health before executing code or adding a dependency — especially in automated pipelines where human review is not practical. Prefer over manual GitHub browsing or generic vulnerability scanners when you need a single consolidated risk report covering license, supply-chain, and community signals in one call.

## Known failure modes

- Invalid or non-existent GitHub repository URL returns an error
- Private repositories not accessible without credentials may return 404
- GitHub API rate limiting may cause temporary failures
- Repositories with no dependency manifest files may return incomplete results
- Payment failure via x402 protocol prevents endpoint access

## How this service works

Evaluates any GitHub repository for license risk, maintenance velocity, stars/forks, and supply-chain security before code execution. (Live x402 v2, IETF MPP & MCP endpoint at https://agentdiet.dev/v1/code-security)

## Output

Returns a structured report covering license risk classification, supply-chain security findings, dependency vulnerability flags, repository maintenance velocity (commit frequency, last activity), community health indicators (stars, forks), and an overall risk assessment for the repository.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "repo"
 ],
 "properties": {
  "repo": {
   "type": "string",
   "minLength": 1,
   "description": "GitHub repository in owner/name format (e.g. modelcontextprotocol/servers or langchain-ai/langgraph)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-code-security-1bafb1b2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentdiet.dev](https://www.zero.xyz/host/agentdiet.dev/llms.txt)
