# API Key Health Watch Autopilot

Authorized Autopilot that checks vault key-slot presence and probe status codes. It does not require or log secret values in the request body.

## Prerequisites
- Amber HQ account
- Plan with Compliance Autopilot / Command Center access
- API key with ca:* scope

## Install / setup
1. Log in at https://hq.amberoneai.com/login
2. Create an API key with ca:* scope
3. Read /docs/platform/api-key-health-watch/
4. POST presence/status samples (no secret values) to the live route

## Live endpoint
`/api/v1/platform/api-key-health-watch/autopilot-cycle`

## Buyer claims (verified in sellability QA)
- **auth**: Unauthorized cycles return AUTHORIZATION_REQUIRED.
- **fail**: 401/403 probe or intentional fail returns FAILED with completeClaimed false.
- **repair**: repairAndRetest can reach COMPLETE.
- **nosecret**: Happy-path request uses slot presence and probe status only — no secret value field.
- **missing**: Missing keys array is rejected.

## Sample: intentional fail
```json
{
  "authorization": {
    "suppliedBy": "buyer",
    "reference": "install_guide",
    "authorized": true
  },
  "keys": [
    {
      "slotId": "openai",
      "present": true,
      "lastProbeStatus": 401
    }
  ]
}
```

## Sample: repair and retest
```json
{
  "authorization": {
    "suppliedBy": "buyer",
    "reference": "install_guide",
    "authorized": true
  },
  "keys": [
    {
      "slotId": "openai",
      "present": true,
      "lastProbeStatus": 200
    }
  ],
  "repairAndRetest": true
}
```

Legal notice: Not legal advice. Autopilot assist only.
