> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rulebase.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Record agent releases from CI

> Send a release to Rulebase on every production deploy so Agent monitoring can mark capabilities shipped and compare before and after.

A release marks when a new version of your AI agent went live. Agent monitoring
uses releases to mark a capability as shipped when you link one to it, and to
compare how often the capability fails before and after that version.

You can add releases by hand on the agent's page under
**Settings > Agent monitoring > Agents**. To record every deploy automatically, call the
releases API from your deploy pipeline.

## What you need

* An organization API key. See [API access](/guides/api-access).
* The agent ID. It's shown in the **Releases** section of the agent's page
  under **Settings > Agent monitoring > Agents**.

## Add a deploy step

After your production deploy succeeds, send the agent ID, a version name, and
the commit:

```bash theme={null}
curl --fail-with-body -X POST https://api.rulebase.co/v1/agent_releases \
  -H "Authorization: Bearer $RULEBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "'"$RULEBASE_AGENT_ID"'",
    "name": "v1.4.2",
    "commit_sha": "'"$GITHUB_SHA"'",
    "released_at": "'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'",
    "notes": "Adds the transfer status tool"
  }'
```

Organizations in the EU region use `https://eu.api.rulebase.co`.

`released_at` defaults to the time of the request. `notes` is optional.

### GitHub Actions

```yaml theme={null}
- name: Record release in Rulebase
  if: success()
  env:
    RULEBASE_API_KEY: ${{ secrets.RULEBASE_API_KEY }}
    RULEBASE_AGENT_ID: ${{ vars.RULEBASE_AGENT_ID }}
  run: |
    curl --fail-with-body --retry 3 -X POST https://api.rulebase.co/v1/agent_releases \
      -H "Authorization: Bearer $RULEBASE_API_KEY" \
      -H "Content-Type: application/json" \
      -d "{\"agent_id\": \"$RULEBASE_AGENT_ID\", \"name\": \"${GITHUB_SHA::7}\", \"commit_sha\": \"$GITHUB_SHA\"}"
```

## Retries

Sending the same `commit_sha` again returns the release that already exists
with status `200` instead of creating a second one. Without a `commit_sha`, the
release `name` is used instead. Retrying a failed deploy step is safe.

## Reference

[Record an agent release](/api-reference/agent-releases/create-agent-release)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.