# Get the attestation policy (https://orgasm.dev/docs/api/trust/getAttestationPolicy)

# Get the attestation policy

- **Method:** `GET`
- **Path:** `/v1/attestation-policy`
- **Operation ID:** `getAttestationPolicy`
- **Tags:** trust

What a device must check in an enclave's attestation before it
publishes media: the token issuer, the confidential-computing hardware,
the enclave image's source and minimum release, and the sealing scheme.
The SDK checks it for you. No key needed.

## Effective servers

- `https://orgasm.dev`

  `sk_test_` keys reach the sandbox. `sk_live_` keys are refused until live analysis is available.
- `http://localhost:3000`

  The docs site running locally (`npm run dev`), which serves the sandbox.
- `http://localhost:4010`

  The standalone sandbox (`npm run mock`), which also serves the WebSocket channel.

## Authentication

No authentication required.

## Query parameters

- **`mode`**: `string`, possible values: `"test", "live"`, default: `"live"`

  The policy for test or live sessions.

## Responses

### 200 The policy.

**Headers:**

- **`Request-Id`**

  Identifies the request; include it when you contact support.

  `string`, pattern: `^req_[0-9a-z]{20}$`
- **`RateLimit-Limit`**

  Requests allowed in the current window.

  `integer`
- **`RateLimit-Remaining`**

  Requests left in the current window.

  `integer`
- **`RateLimit-Reset`**

  Seconds until the window resets.

  `integer`

**Content type:** `application/json`

schema: `AttestationPolicy`

What an enclave's attestation must show before a device sends it media. In test mode no enclave runs, and the policy says so.

- **`debugAllowed` (required)**: `boolean`

  Whether a debuggable enclave is accepted. Never in live mode.
- **`enforced` (required)**: `boolean`

  Whether devices must verify an attestation in this mode.
- **`evidence` (required)**: `object`

  How the enclave signs its answers to the device.
  - **`algorithm` (required)**: `string`, const: `"Ed25519"`
- **`hardware` (required)**: `array of string`

  The confidential-computing hardware the enclave must run on.
- **`image` (required)**: `object`
  - **`digests` (required)**: `array`

    Accepted image digests. Empty: any digest that carries an accepted signature and an accepted release.

    **Items:**

    `string`, pattern: `^sha256:[0-9a-f]{64}$`
  - **`minRelease` (required)**: `string | null`

    The oldest enclave release accepted.
  - **`releasesUrl` (required)**: `string | null`, format: `uri`

    Every release, the digest it built and the commands that check it.
  - **`repository` (required)**: `string | null`

    The public registry that holds each released digest with its SLSA provenance and keyless signature.
  - **`signers` (required)**: `array`

    The keys the image must be signed by, as hex SHA-256 fingerprints of their public keys: the attestation reports the keys the launcher verified the image's signature with in `submods.container.image_signatures[].key_id`.

    **Items:**

    `string`, pattern: `^[0-9a-f]{64}$`
  - **`source` (required)**: `string | null`, format: `uri`

    The public source the enclave image is built from.
- **`issuer` (required)**: `string | null`, format: `uri`

  The issuer the attestation token must be signed by.
- **`mode` (required)**: `string`, possible values: `"test", "live"`
- **`object` (required)**: `string`, const: `"attestation_policy"`
- **`seal` (required)**: `object`
  - **`schemes` (required)**: `array`

    **Items:**

    `string`, possible values: `"v1"`
- **`updatedAt` (required)**: `string`, format: `date-time`
- **`verify` (required)**: `object | null`, schema: `VerifierValues`

  What the enclave's own verifier (`tee-verify`, in the enclave's source) holds a running enclave to, for the enclaves this mode's sessions run on. `null` in test mode.
  - **`captureBucket` (required)**: `string`

    The one bucket the enclave may write a session record to, its attested `TEE_CAPTURE_BUCKET` (`-capture-bucket`); empty for an enclave that keeps none. A lease names a record only when it asks for one, and orgasm.dev's never do.
  - **`imageRefPrefixes` (required)**: `array of string`

    Where the enclave's image may have been pulled from (`-image-ref-prefix`).
  - **`imageRepo` (required)**: `string`

    The public registry that holds the digest with its provenance (`-image-repo`).
  - **`invokers` (required)**: `array of string`

    Exactly the identities the enclave's control routes may take a token from, its attested `TRAINER_INVOKER_SERVICE_ACCOUNT` (`-trainer-invoker`).
  - **`minRelease` (required)**: `string | null`

    The oldest release accepted (`-min-release`).
  - **`projectIds` (required)**: `array of string`

    The Google Cloud projects the enclave may run in (`-project-id`).
  - **`readingsUrl` (required)**: `string`, format: `uri`

    Where the enclave must post its readings, its attested `TRAINER_URL` (`-trainer-url`).
  - **`requestSeal` (required)**: `string`

    The sealing scheme requests must use, its attested `TEE_REQUEST_SEAL` (`-request-seal`).
  - **`signerKeyIds` (required)**: `array`

    Accepted image signing keys (`-signer-key-ids`).

    **Items:**

    `string`, pattern: `^[0-9a-f]{64}$`
  - **`sourceUri` (required)**: `string`

    The repository the image's SLSA provenance must name (`-source-uri`).
- **`version` (required)**: `string`
- **`note`**: `string`

**Example:**

```json
{
  "object": "attestation_policy",
  "mode": "test",
  "version": "",
  "enforced": true,
  "issuer": null,
  "hardware": [
    ""
  ],
  "image": {
    "source": null,
    "minRelease": null,
    "digests": [
      ""
    ],
    "signers": [
      ""
    ],
    "repository": null,
    "releasesUrl": null
  },
  "seal": {
    "schemes": [
      "v1"
    ]
  },
  "evidence": {
    "algorithm": "Ed25519"
  },
  "debugAllowed": true,
  "verify": {
    "sourceUri": "",
    "imageRepo": "",
    "signerKeyIds": [
      ""
    ],
    "minRelease": null,
    "readingsUrl": "",
    "invokers": [
      ""
    ],
    "captureBucket": "",
    "requestSeal": "",
    "projectIds": [
      ""
    ],
    "imageRefPrefixes": [
      ""
    ]
  },
  "note": "",
  "updatedAt": ""
}
```

### 429 Too many requests; wait \`Retry-After\` seconds.

**Headers:**

- **`Request-Id`**

  Identifies the request; include it when you contact support.

  `string`, pattern: `^req_[0-9a-z]{20}$`
- **`RateLimit-Limit`**

  Requests allowed in the current window.

  `integer`
- **`RateLimit-Remaining`**

  Requests left in the current window.

  `integer`
- **`RateLimit-Reset`**

  Seconds until the window resets.

  `integer`
- **`Retry-After`**

  Seconds to wait before retrying.

  `integer`

**Content type:** `application/problem+json`

schema: `Problem`

An error, as RFC 9457 problem details. `type` links to the explanation of `code` in the docs.

- **`code` (required)**: `string`, possible values: `"invalid_request", "consent_required", "capability_required", "sandbox_only", "authentication_required", "invalid_api_key", "live_mode_unavailable", "credits_exhausted", "permission_denied", "not_found", "idempotency_key_reused", "session_ended", "sandbox_no_media", "upload_already_received", "payload_too_large", "rate_limited", "capacity_unavailable", "internal_error"`

  A stable, machine-readable error code.
- **`status` (required)**: `integer`

  The HTTP status code.
- **`title` (required)**: `string`

  A short summary of the error.
- **`type` (required)**: `string`, format: `uri`

  A link to the docs for this error.
- **`detail`**: `string`

  What went wrong in this request, and what to do.
- **`errors`**: `array`

  Each contract violation, when the body or a parameter did not match the contract.

  **Items:**
  - **`location` (required)**: `string`, possible values: `"path", "query", "header", "cookie", "body"`
  - **`message` (required)**: `string`
  - **`path` (required)**: `string`

    JSON pointer to the value at fault.
- **`instance`**: `string`

  The request path.
- **`param`**: `string | null`

  The request field at fault, as a dotted path, when there is one.
- **`requestId`**: `string`

**Example:**

```json
{
  "type": "https://orgasm.dev/docs/guides/errors#rate_limited",
  "title": "Too many requests",
  "status": 429,
  "code": "rate_limited",
  "detail": "Retry after 2 seconds.",
  "requestId": "req_3k6m9q2t5w8z1c4f7h0j"
}
```

## Schemas

- `Problem` — shown above.

### ErrorCode

**Type:** `string`, possible values: `"invalid_request", "consent_required", "capability_required", "sandbox_only", "authentication_required", "invalid_api_key", "live_mode_unavailable", "credits_exhausted", "permission_denied", "not_found", "idempotency_key_reused", "session_ended", "sandbox_no_media", "upload_already_received", "payload_too_large", "rate_limited", "capacity_unavailable", "internal_error"`

A stable, machine-readable error code.

- `AttestationPolicy` — shown above.
- `VerifierValues` — shown above.
