Skip to main content
Agent lifecycle management ensures that every AI agent has an expiry date, a review schedule, and a responsible sponsor. Expired and unreviewed agents surface automatically so you can decommission stale agents and enforce periodic access reviews.

Lifecycle Fields

FieldTypeDescription
expires_atISO 8601 datetimeWhen the agent authorization expires
review_frequencyweekly | monthly | quarterly | annuallyHow often the agent must be reviewed
sponsor_idstringThe person or team responsible for this agent

Set Agent Lifecycle

curl -X PATCH https://api.meshai.dev/agents/agt_abc123/lifecycle \
  -H "Authorization: Bearer msh_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "expires_at": "2026-06-30T23:59:59Z",
    "review_frequency": "quarterly",
    "sponsor_id": "ml-platform-team"
  }'
{
  "success": true,
  "data": {
    "agent_id": "agt_abc123",
    "expires_at": "2026-06-30T23:59:59Z",
    "review_frequency": "quarterly",
    "next_review_at": "2026-06-18T00:00:00Z",
    "sponsor_id": "ml-platform-team",
    "updated_at": "2026-03-18T10:00:00Z"
  }
}
You can set any combination of fields — all are optional. Only the fields you include are updated.

List Expired Agents

Returns agents whose expires_at date has passed. Use this to identify agents that need decommissioning or renewal.
curl https://api.meshai.dev/agents/expired \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
{
  "success": true,
  "data": [
    {
      "id": "agt_old001",
      "name": "legacy-support-bot",
      "expires_at": "2026-02-28T23:59:59Z",
      "sponsor_id": "support-team",
      "status": "healthy",
      "days_expired": 18
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 25
  }
}

List Agents Due for Review

Returns agents whose next review date has passed or is approaching. Use this to enforce periodic access reviews.
curl https://api.meshai.dev/agents/due-review \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
{
  "success": true,
  "data": [
    {
      "id": "agt_abc123",
      "name": "customer-support-agent",
      "review_frequency": "quarterly",
      "next_review_at": "2026-03-15T00:00:00Z",
      "sponsor_id": "ml-platform-team",
      "days_overdue": 3
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 25
  }
}

Review Frequency Options

FrequencyReview interval
weeklyEvery 7 days
monthlyEvery 30 days
quarterlyEvery 90 days
annuallyEvery 365 days
The next_review_at date is automatically calculated from the last review date (or lifecycle creation date) plus the review interval.

Audit Trail

Lifecycle changes are tracked in the audit trail:
Event TypeDescription
agent.lifecycle.updatedLifecycle fields changed (includes old and new values)
agent.expiredAgent passed its expiry date
agent.review.dueAgent review is overdue

Use Cases

  • Compliance — EU AI Act requires periodic review of high-risk AI systems. Set review_frequency to quarterly for high-risk agents.
  • Shadow agent cleanup — Set short expiry dates on newly discovered agents to force review.
  • Team accountability — Assign sponsor_id so every agent has a responsible owner.
  • Automatic decommissioning — Combine with the kill switch to auto-block expired agents.