Reclassification API
Part of CLPI Phase 2: Card Lifecycle & Trust Recovery. The Reclassification API enables violation reclassification and trust score recovery.
https://api.mnemom.ai/v1
Authentication
All reclassification endpoints require API key authentication. Pass your key in theAuthorization header:
POST /v1/api-keys.
| Endpoint | Auth Required | Notes |
|---|---|---|
POST /v1/agents/{agent_id}/reclassify | API key | Reclassify a checkpoint violation |
POST /v1/reputation/{agent_id}/recompute | API key | Trigger score recomputation |
GET /v1/agents/{agent_id}/compliance-export | API key | Export compliance record |
GET /v1/agents/{agent_id}/reclassifications | API key | List reclassification history |
GET /v1/agents/{agent_id}/card-amendments | API key | List card amendment history |
Rate Limits
| Endpoint | Rate Limit | Window |
|---|---|---|
POST /agents/{agent_id}/reclassify | 30 requests | per minute |
POST /reputation/{agent_id}/recompute | 10 requests | per minute |
GET /agents/{agent_id}/compliance-export | 10 requests | per minute |
| Other endpoints | 60 requests | per minute |
429 with a Retry-After header.
Endpoints
POST /v1/agents//reclassify
Reclassify a checkpoint violation ascard_gap or behavior_gap. Card-gap reclassifications indicate that the agent behaved correctly but the card definition was incomplete. Behavior-gap reclassifications indicate a genuine agent misbehavior that should remain on record.
Parameters:
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | string | Yes | Agent identifier |
| Field | Type | Required | Description |
|---|---|---|---|
checkpoint_id | string | Yes | ID of the checkpoint to reclassify |
reason | string | Yes | Human-readable explanation for the reclassification |
card_amendment_id | string | No | Link to a card amendment that fixes the gap |
200 OK
| Field | Type | Description |
|---|---|---|
reclassification_id | string | Unique identifier for this reclassification |
checkpoint_id | string | The checkpoint that was reclassified |
agent_id | string | Agent identifier |
original_type | string | Original violation type before reclassification |
new_type | string | New classification: card_gap or behavior_gap |
reason | string | Human-readable explanation |
card_amendment_id | string | Linked card amendment ID, if provided |
approved_by | string | User who approved the reclassification |
created_at | string | ISO 8601 timestamp |
score_impact | object | Score impact summary |
score_impact object:
| Field | Type | Description |
|---|---|---|
score_before | number | Score at time of reclassification |
score_after | number | null | Score after recomputation, or null if pending |
recomputation_pending | boolean | Whether a recomputation is needed to reflect this change |
| Status | Meaning |
|---|---|
400 | Missing or invalid parameters |
401 | API key required |
404 | Checkpoint or agent not found |
409 | Checkpoint has already been reclassified |
POST /v1/reputation//recompute
Trigger score recomputation after reclassification. Scores are recomputed withcard_gap violations excluded from the compliance and drift stability components. Recomputation propagates through the agent’s delegation graph using the configured decay factor.
Parameters:
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | string | Yes | Agent identifier |
200 OK
| Field | Type | Description |
|---|---|---|
agent_id | string | Agent identifier |
score_before | number | Composite score before recomputation |
score_after | number | Composite score after recomputation |
grade_before | string | Letter grade before recomputation |
grade_after | string | Letter grade after recomputation |
reclassifications_applied | number | Number of reclassifications factored into this recomputation |
propagation | object | Delegation graph propagation details |
recomputed_at | string | ISO 8601 timestamp of recomputation |
propagation object:
| Field | Type | Description |
|---|---|---|
agents_affected | number | Total agents whose scores were updated via delegation propagation |
max_depth | number | Maximum depth reached in the delegation graph |
decay_factor | number | Decay factor applied at each delegation hop |
| Status | Meaning |
|---|---|
401 | API key required |
404 | Agent not found |
GET /v1/agents//compliance-export
Export the full compliance record for an agent, including all violations, reclassifications, card amendments, and score history. Designed for audit purposes and regulatory compliance workflows. Parameters:| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | string | Yes | Agent identifier |
200 OK
| Field | Type | Description |
|---|---|---|
agent_id | string | Agent identifier |
export_date | string | ISO 8601 timestamp of the export |
violations | array | All recorded violations for this agent |
reclassifications | array | All reclassification records |
card_amendments | array | All card amendment records |
score_history | array | Historical score snapshots |
integrity_chain_valid | boolean | Whether the integrity chain is intact and tamper-free |
| Status | Meaning |
|---|---|
401 | API key required |
404 | Agent not found |
GET /v1/agents//reclassifications
List reclassification history for an agent. Returns paginated results ordered by creation date (newest first). Parameters:| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | string | Yes | Agent identifier |
page | query | number | No | Page number (default: 1) |
per_page | query | number | No | Results per page (default: 20, max: 100) |
200 OK
| Status | Meaning |
|---|---|
401 | API key required |
404 | Agent not found |
GET /v1/agents//card-amendments
List card amendment history for an agent. Returns paginated results ordered by creation date (newest first). Parameters:| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | string | Yes | Agent identifier |
page | query | number | No | Page number (default: 1) |
per_page | query | number | No | Results per page (default: 20, max: 100) |
200 OK
| Status | Meaning |
|---|---|
401 | API key required |
404 | Agent not found |
Error Codes
| Status | Code | Description |
|---|---|---|
400 | invalid_request | Missing or invalid parameters |
401 | unauthorized | API key required but not provided or invalid |
404 | checkpoint_not_found | Checkpoint ID does not exist |
404 | agent_not_found | Agent ID does not exist |
409 | already_reclassified | Checkpoint has already been reclassified |
429 | rate_limited | Too many requests; check Retry-After header |
500 | internal_error | Server error; retry with exponential backoff |
SDK Usage
See Also
- Card Lifecycle — Reclassification concepts
- Trust Recovery Guide — Step-by-step workflow
- Reputation Scores — Score computation
- Policy API — Policy management