---
title: "VIPER Request Signing"
description: "Sign a site's LLM requests with its notary key, send them straight to the upstream or through a Guardian gateway, and enroll the site as a Guardian agent."
source: "EQTY Notary"
---
import { Image } from "astro:assets";
import viperShot from "../../../assets/browser-notary/popup-viper.png";

VIPER signs the LLM requests a site makes, with that site's notary key, so a Guardian gateway can
check who sent each request and what it carried. The site's code does not change: the extension
picks up its `fetch` calls to LLM APIs, signs them and sends them itself, and the page gets an
ordinary `Response` back.

VIPER is turned on per site, in the popup, and only once the [notary](./install.mdx#3-check-it-in-the-popup)
is on for that site: it signs with the site's notary key, the one the browser key certifies with
`VCompBrowserOriginV1`. Turning the notary off turns VIPER off too.

<Image src={viperShot} alt="The popup's VIPER screen for http://localhost:18767: the VIPER switch, the site's signing key with a New key button, requests going direct to their upstream, and enrollment not needed in direct mode" width={400} class="ui-shot" />

## What gets signed

`fetch` POSTs whose path ends in one of these, from a site with VIPER on:

| Path | API shape |
| ---- | --------- |
| `/chat/completions`, `/completions`, `/responses`, `/embeddings` | OpenAI |
| `/messages`, `/messages/count_tokens`, `/complete` | Anthropic |

Every other request, and every request from a site with VIPER off, goes to the browser's own
`fetch` untouched. `XMLHttpRequest` and requests made outside the page's `fetch` are not signed.

## The signature

The request is signed as the EQTY Guardian LLM gateway verifies it, its `viper.v2` profile of
RFC 9421 HTTP message signatures:

```text
Signature-Input: sig=("@method" "@target-uri" "x-viper-nonce" "x-viper-timestamp"
                      "content-digest" "x-viper-credential-cid"
                      ["x-viper-project-urn"] ["x-viper-upstream-url"])
                 ;alg="ecdsa-p256-sha256";created=…;keyid="did:key:zDn…"
Content-Digest:  sha-256=:…:, blake3=:…:
```

The signature goes through the notary's `sign`, so it is made by the site key and recorded in the
audit log like any other signature. `x-viper-credential-cid` names the credentials that back it,
as JCS blobs:

- a self-issued **`StateAttestation`**: the caller, the browser, whether the chain is anchored,
  and the request;
- the site's **notary chain**: `VCompTpmV1` → `VCompProcessV1` → `VCompBrowserOriginV1` when
  anchored, the browser's self-issued root when not;
- through a gateway, the site's **registration credential** and, with a project set, its
  **project membership**.

## Direct and relay

| Mode | When | Where requests go |
| ---- | ---- | ----------------- |
| **Direct** | **Guardian gateway** is empty in VIPER settings | Straight to the upstream the page asked for, signed. Nothing checks the signature until a gateway is set. |
| **Relay** | **Guardian gateway** is set | The credentials are uploaded first (`PUT {gateway}/v1/blobs/{cid}`, signed), then the request goes to `{gateway}/v1/relay`, with the upstream in a signed `x-viper-upstream-url` header. The site is enrolled first. |

The response comes back to the page with these headers added, so the app can record what was
signed next to what came back:

| Header | Value |
| ------ | ----- |
| `x-viper-keyid` | The site key's `did:key` |
| `x-viper-signature-input`, `x-viper-signature` | The RFC 9421 signature |
| `x-viper-credential-cid` | The credential CIDs, comma-separated |
| `x-viper-mode` | `direct` or `relay` |

A page can ask whether its requests are being signed, without consent:

```js
await eqtyNotary.viperStatus()
// { enabled: true, mode: "relay" }
```

## Enrollment

Through a gateway, a site must be a registered Guardian agent before its requests are accepted.
The extension enrolls it automatically on its first request, the way OpenShell's supervisor
enrolls a sandbox:

1. The **enrollment API key** (VIPER settings) mints a provisioning token at
   `{control plane}/api/v1/agent-registration-tokens`.
2. The gateway redeems the token at `/v1/agents/registrations` for the site's notary DID
   (`409`: already registered).
3. With a **project** set, the Integrity service issues the agent a 90-day
   `ProjectMembershipV1`, which Guardian indexes. Requests then carry `x-viper-project-urn`.

The VIPER screen shows the site's agent ID, or the error, with **Enroll** / **Retry**. The API
key stays in extension storage and goes only to Guardian (control plane and gateway) and
Integrity, never to pages; it is never shown again once saved.

### Keys and agents

A site keeps its Guardian agent ID across key changes:

| Action | Where | Effect |
| ------ | ----- | ------ |
| **New key** | VIPER screen | The site gets a new notary key. The new DID joins the same agent with the API key (`POST {gateway}/v1/agents/registrations` with `agent_id`), keeping its project membership. The old key stays active in Guardian until an admin removes it (`DELETE /v1/agents/{id}/keys/{did}`). |
| **New agent ID** | VIPER screen | Forgets the agent; the next enrollment creates a new one through a token. |
| **Join existing agent…** | VIPER screen | Joins an agent made elsewhere as a replica, like `viper did register --agent-id`. A failed join leaves the site on its previous agent. |
| **Agent ID to join** | VIPER settings | The same for every site without an agent of its own, like `VIPER_AGENT_ID`. |

A replica joins with the API key, with no display name (it keeps the agent's) and no app type (so
a browser can join an agent of any app). The key's owner must operate the agent.

## Deleting a site's VIPER data

The trash icon on the VIPER screen deletes everything VIPER holds for the site: its switch, its
enrollment, its agent ID and its VIPER activity. Click it, then click again on **Delete?** within
four seconds to confirm. The site's notary key and permission stay; the agent stays in Guardian
until an admin removes it.

## Settings

The gear on the VIPER screen opens VIPER settings, which also lists the sites that have VIPER on.

| Setting | Default | Meaning |
| ------- | ------- | ------- |
| **Guardian gateway** | empty | Empty: direct mode. Set: relay mode, after enrolling the site. |
| **Enrollment API key** | none | A Guardian API key with the Register Agents scope. Leave empty to keep the saved key; **Remove** deletes it. |
| **Agent ID to join** | none | Sites without an agent of their own register as replicas of this agent. |
| **Project** | none | Enrolled sites get a 90-day membership in this project. |
| **Guardian control plane** | `https://cp.guardian.dev.eqtylab.io`, prefix `/api` | Mints registration tokens and indexes memberships, at `{control plane}{prefix}/v1`. |
| **Integrity service** | `https://guardian.dev.eqtylab.io/integrityService` | Issues project memberships. |

## Limits

- **No streaming.** Responses are buffered: a server-sent-events body arrives in one piece, when
  the request completes.
- Request bodies must be under 10 MiB.
- A page that keeps its own reference to the original `fetch` bypasses signing. A gateway refuses
  unsigned requests, so this only skips VIPER, it does not forge it.
- Aborting the request with an `AbortController` cancels it in the extension too. A failure to
  sign or send rejects with a `TypeError`, as a network failure in `fetch` does.