# VYRDON Execution Certificate — Customer Product Packet

## 1. What the Customer Submits

```
POST https://api.vyrdon.com/api/vyrden/task
x-api-key: <your_api_key>
Content-Type: application/json

{
  "type": "inference",
  "payload": {
    "prompt": "Your instruction or query here"
  }
}
```

Required fields:
- `type` — must be `"inference"`
- `payload.prompt` — the instruction or query (non-empty string)

Optional fields:
- `payload.targetAgent` — route to a specific engine (default: `"DIR-1"`)
- `payload.model` — request a specific model (e.g., `"@cf/meta/llama-3.1-8b-instruct-fast"`)

Authentication: `x-api-key` header with a valid VYRDON API key scoped to `airoom:chat`.

---

## 2. What VYRDON Executes

On submission, VYRDON:
1. Validates the API key and scope
2. Logs an audit event for the request
3. Routes the prompt to the private VYRDEN AI Room bridge
4. Executes inference on Cloudflare AI Workers (`@cf/meta/llama-3.1-8b-instruct-fast`)
5. Stores the completed result with provider metadata
6. Logs a completion audit event

Response to customer (HTTP 202):

```json
{
  "request_id": "68333615-...",
  "task_id": "26f4f652-...",
  "status": "completed",
  "result": {
    "provider": "cloudflare_ai",
    "model": "@cf/meta/llama-3.1-8b-instruct-fast",
    "content": "..."
  },
  "audit_event_id": "0762fb3f-..."
}
```

The `task_id` is the primary identifier for retrieving the execution certificate.

---

## 3. What Certificate They Receive

```
GET https://api.vyrdon.com/api/vyrdon/certificate/:taskId
x-api-key: <your_api_key>
```

Response:

```json
{
  "certificate_id": "cert_94e7a589-...",
  "certificate_type": "VYRDON_EXECUTION_CERTIFICATE",
  "public_verdict": "VERIFIED_EXECUTION",
  "request_id": "68333615-...",
  "task_id": "26f4f652-...",
  "audit_event_id": "0762fb3f-...",
  "status": "completed",
  "provider": {
    "name": "cloudflare_ai",
    "model": "@cf/meta/llama-3.1-8b-instruct-fast",
    "real_execution": true
  },
  "execution": {
    "submitted_at": "2026-06-27T18:46:24.204Z",
    "completed_at": "2026-06-27T18:46:26.213Z",
    "latency_ms": 1392
  },
  "evidence": {
    "task_status_hash": "sha256...",
    "result_summary_hash": "sha256...",
    "audit_event_hash": "sha256...",
    "certificate_hash": "1b5737671d32b44da160f4ad5a584dc27d9439165bfc94fd7d93af4b12021daf"
  },
  "verification": {
    "api_domain": "https://api.vyrdon.com",
    "auth_enforced": true,
    "scope_enforced": true,
    "private_runtime_bridge": true,
    "secret_redaction": true
  }
}
```

Certificate can also be retrieved directly by its own ID:

```
GET https://api.vyrdon.com/api/vyrdon/certificate/id/:certificateId
x-api-key: <your_api_key>
```

---

## 4. What the Certificate Proves

| Claim | How the certificate proves it |
|-------|------------------------------|
| Task was submitted | `request_id`, `task_id`, `audit_event_id` recorded at submission time |
| Execution happened | `provider.name` = `cloudflare_ai`, `real_execution` = `true` |
| Execution was not mocked | `real_execution` = `true` (excludes `disabled_mock`, `passthrough`, `provider_not_configured`) |
| Execution timestamp | `execution.submitted_at`, `execution.completed_at` with ISO-8601 timestamps |
| Model used | `provider.model` identifies the exact model |
| Content integrity | `evidence.task_status_hash` — SHA-256 of task identity<br>`evidence.result_summary_hash` — SHA-256 of result summary (provider, model, latency, content length/prefix)<br>`evidence.audit_event_hash` — SHA-256 of audit event |
| Certificate integrity | `evidence.certificate_hash` — SHA-256 of the entire certificate object (computed before storage, verified on retrieval) |
| Execution environment | `verification.private_runtime_bridge` — execution ran through the private bridge, not a public third-party call |
| Secret safety | `verification.secret_redaction` — all API keys, tokens, and credentials are redacted from the certificate packet |

---

## 5. How to Verify

### Verify by certificate ID

```
GET https://api.vyrdon.com/api/vyrdon/certificate/id/:certificateId/verify
x-api-key: <your_api_key>
```

Response:

```json
{
  "certificate_id": "cert_94e7a589-...",
  "certificate_hash": "1b5737671d32b44da160f4ad5a584dc27d9439165bfc94fd7d93af4b12021daf",
  "verified": true,
  "reason": "CERTIFICATE_HASH_MATCH"
}
```

If `verified` is `true`, the stored certificate hash matches a freshly computed hash — the certificate has not been tampered with.

If `verified` is `false` and `reason` is `CERTIFICATE_HASH_MISMATCH`, the certificate data has been altered since issuance.

### Lookup by certificate hash

```
GET https://api.vyrdon.com/api/vyrdon/certificate/lookup?hash=<sha256>
x-api-key: <your_api_key>
```

Response:

```json
{
  "count": 1,
  "certificates": [
    {
      "certificate_id": "cert_94e7a589-...",
      "certificate_hash": "1b573767...",
      "task_id": "26f4f652-...",
      "created_at": "2026-06-27T18:46:25.001Z",
      "verified": true
    }
  ]
}
```

This allows a third party to confirm that a certificate hash exists in the VYRDON evidence ledger.

---

## 6. What Is Excluded / Redacted

The certificate packet never contains:

- **API keys** — `x-api-key` header values, `vyrdon_live_*` and `vyrdon_staging_*` keys
- **Service tokens** — `x-vyrden-service-token` values
- **Bearer tokens** — any `Bearer <token>` strings
- **Cloudflare tokens** — `cfat_*` tokens
- **AWS secrets** — `AKIA*` access keys
- **Private keys** — PEM `-----BEGIN *-----` blocks
- **Raw inference content** — the result content is hashed but not included; only a summary (provider, model, latency, content length/prefix) is hashed
- **Sensitive field names** — any field named `token`, `secret`, `key`, `password`, `credential`, `auth`, `bearer`, `api_key` is entirely replaced with `[REDACTED_<NAME>]`

What the certificate **does** include:
- Task identity (`request_id`, `task_id`, `audit_event_id`)
- Provider proof (`name`, `model`, `real_execution`)
- Execution timing (`submitted_at`, `completed_at`, `latency_ms`)
- Cryptographic hashes of the task, result summary, audit event, and certificate
- Verification metadata (auth mode, bridge mode, redaction status)

---

## 7. Access & Next Steps

### Getting an API key

Contact the VYRDON team to request an API key with the `airoom:chat` scope.

### Authentication

All certificate endpoints accept either:
- `airoom:chat` scope — full task submission and certificate access
- `certificate:read` scope — certificate retrieval and verification (read-only)

| Endpoint | No key | Bad key | Wrong scope | Valid key |
|----------|--------|---------|-------------|-----------|
| All certificate endpoints | 401 | 401 | 403 | 200 |

### Rate limits

- 200 requests per 15-minute window per IP (shared global limit)

### Support

Contact: `contact@vyrdon.com`
