Developers / Client

Governance-safe client

The Elevated Context client

Limited — TypeScript

@elevatedcontext/client is a thin, misuse-resistant wrapper over the governed request protocol. It is built so the wrong call does not compile: there is no way to set a tenant, a principal, a role, a recipient class, or a server decision, and no way to pass a raw prompt. The server remains the sole authority; the client carries none.

What this is, and isn’t. This is a real TypeScript/JavaScript client used in our own MCP tool. It is not a generally-available, multi-language SDK — there is no Python, Go, or Java client. It is not published to a public registry yet; access is early-access and workspace-linked. The sample below shows the actual public shape; treat it as illustrative until you have access.

Design in one line

You express a request with three things — a controlled purpose, an optional narrow scope, and a recipient — and you get back a typed governance outcome. Authority is never a parameter.

Make a request

The public surface is createClient(...) plus branded value objects. A request to a human principal needs no signer; an application recipient requires one at the type level (the call will not compile without it).

import {
  createClient,
  createWebCookieTransport,
  purpose,
  Scope,
  Recipient,
  isAllowed,
  isPendingConsent,
} from "@elevatedcontext/client";

const ec = createClient({
  transport: createWebCookieTransport({ origin: "https://api.elevatedcontext.com" }),
  audience: "https://api.elevatedcontext.com",
});

const result = await ec.context.request({
  purpose: purpose("GENERAL_QA"),          // a controlled id, never free text
  scope: Scope.sensitivityCeiling("INTERNAL"), // narrow-only; never widens
  recipient: Recipient.humanPrincipal(),   // no signer required for a person
});

if (isAllowed(result)) {
  // result carries references to governed context + a receipt — never widened authority
} else if (isPendingConsent(result)) {
  // the person must approve in the app under App Permissions, then retry
}

Exact value-object constructors are versioned with the package; your access build ships the authoritative type definitions.

Typed outcomes

Every request resolves to one typed outcome, each with a type guard: Allowed, Withheld, Denied, PendingConsent, StepUpRequired, ReauthRequired, RecipientInvalid, RecipientReplay, Unavailable, UnsupportedProtocol, and UnknownOutcome. A governance denial is a normal resolved result, not a thrown error.

What the client will not let you do

Relationship to MCP

The Elevated Context MCP tool is built on this client. If your AI assistant speaks MCP, start there — you get the same governance without writing client code.

← All developer paths Governed request API →