Developers / AAES Govern / SDKs

Two SDKs.
One service contract.

Use Python or TypeScript to call your AAES Govern service, or call the HTTP API from any language. Governed action requests select registered capabilities rather than caller-supplied application destinations or credentials. These are the AAES Govern SDKs. AAES Operate has its own Python and TypeScript clients for operate/v1, supplied with the evaluation package. For AAES Infer, use the official OpenAI or Anthropic SDK pointed at your Infer endpoint.

This page describes AAES Govern’s controls. AAES Operate has private-work permissions, operational reviews and recorded-spend limits; it does not include Govern. About AAES Govern

Connect to your AAES Govern service

The evaluation package comes only with a paid, scoped evaluation. You run it in your environment, or AAES hosts the evaluation for a fixed fee. The platform package holds binaries only. The SDKs are not in it; install them from PyPI or npm. The Python SDK package is aaes-govern-sdk and the TypeScript SDK package is @aaes-ai/govern-sdk. Published releases are aaes-govern-sdk 0.1.3 on PyPI and @aaes-ai/govern-sdk 0.2.0 on npm. Earlier releases remain under aaes-sdk and @aaes-ai/sdk. From other languages, call the HTTP API using the OpenAPI contract.

AAES_ENDPOINT
The daemon address configured with platform -listen. The listener defaults to 127.0.0.1:8090. Packaged Compose uses TLS by default; native TLS requires a certificate/key pair. Plain HTTP needs -allow-insecure-http. SDKs permit plaintext HTTP only to an explicit loopback address. Use your operator's HTTPS endpoint and configure trusted certificate roots for your language runtime.
AAES_TOKEN
The operator-issued bearer token. The credential resolves the tenant. The SDKs fill tenant_id and actor_id so they match the token.

These examples assume a running daemon and a token associated with a registered caller. Set AAES_ENDPOINT and AAES_TOKEN first. Each example reads the capabilities the caller may use.

For routes and the HTTP contract, see the API reference and download the OpenAPI 3.1 contract. Remaining integration notes ship with the evaluation package.

Python

Install aaes-govern-sdk from PyPI. The runtime uses only the standard library; annotated source and PEP 561 metadata are included. Package metadata requires Python 3.9+:

python3 -m pip install aaes-govern-sdk

For an offline environment, use the wheel and version recorded in your package manifest. The published Python SDK 0.1.3 wheel is named:

python3 -m pip install ./aaes_govern_sdk-0.1.3-py3-none-any.whl

Read the caller's permitted capabilities:

from aaes import AaesError, Client

try:
    result = Client.from_env().capabilities()
    print(f"{len(result.capabilities)} permitted capabilities")
except AaesError as error:
    raise SystemExit(str(error))

JavaScript

Install @aaes-ai/govern-sdk from npm. The ESM package metadata permits Node 18+; that installation floor is distinct from the supported evaluation runtimes below. Public TypeScript declarations and wire response types are included. JavaScript method names are camelCase throughout:

npm install @aaes-ai/govern-sdk

For an offline environment, install the matching supplied tarball. This example names TypeScript SDK 0.2.0; use the filename and version recorded in your package manifest:

npm install ./aaes-ai-govern-sdk-0.2.0.tgz

Import the installed package:

import { Client } from "@aaes-ai/govern-sdk";

try {
  const result = await Client.fromEnv().capabilities();
  console.log(`${result.capabilities.length} permitted capabilities`);
} catch (error) {
  console.error(String(error));
  process.exitCode = 1;
}

Read the method and authorization matrix. New read APIs retain daemon wire names, such as task_id; existing action results retain their language-native fields.

Release changes: Python changelog, TypeScript changelog.

Methods and helpers

The table lists Python entry points. JavaScript uses camelCase (requestAccess, presentGrant). Use the SDK methods page for the full matrix.

Python entry pointPurpose
Client.from_env()Construct a client from the environment.
capabilitiesRead the capabilities this caller may use.
catalogRead capabilities this caller can request access to.
healthCheck daemon health.
actionRecord a decision and, when allowed, mint a grant. Does not execute the downstream action.
brokeredDecide, then execute through AAES Govern's connector.
federateFederation interface; unavailable in the supplied distribution. Calls return 403 ("no federated backend") until an operator wires a minting backend.
present_grantBind a stored grant to the authenticated caller.
request_accessSubmit an access request.
access_requestRead an access request.
observeReport an effect authorized under pass_through custody.
refreshClear the cached caller identity so the next action fetches it again.
verify_hintA helper, not receipt verification. Use the public aaesverify CLI to check export integrity.
list_task, taskBounded task pages and one task record.
list_approvals, approvalAuthorized approval queue and intent-bound decisions.
list_entitlementsUsable, expired, and revoked access for the permitted actor.
list_receipts, receiptScoped sealed evidence with daemon-reported coverage: an AAES-defined accounting measure over the configured and captured population, not a measure of all enterprise agent activity.
manager_cards, decide_manager_cardAgent-manager inbox and explicit bound decisions; never automatically retried.
OperatorClient, revoke_access_requestSeparate person-token client for access revocation; not an agent authority grant.

Daemon refusals are JSON with a reason. A remedy is included when the daemon can name the smallest change that would satisfy the refusal.

Request safety and verification

  • Registered destinations. An action does not accept a caller-supplied application URL, HTTP method, or credential. Brokered calls use deployment-controlled application credentials. Federation, when separately wired and validated, instead returns credential material or issuance instructions and the registered target to the caller. The bearer token authenticates the daemon caller; it is not an application credential to embed in an action.
  • Caller identity. tenant_id and actor_id are claims that must match the token. The SDKs fill them.
  • Explicit retries. Retries are opt-in, limited to 503, and require the original effect key: the identifier that keeps a repeat tied to the same requested action. Enable automatic retries only for operations and failure stages documented by your release. Never use a new key to get past a conflict or an uncertain result.
  • Receipt verification. The SDKs do not verify receipts. Use the public aaesverify CLI to check export integrity. From v0.3.0 it also verifies aaes.trust-receipt/v1 receipts with --receipt and binds a current records sidecar with --records. Stored records outside that profile need the separate operator binding check.

Decide what to do after a failed request

An HTTP status describes the response from AAES. It does not, on its own, establish what happened in the provider's system. Check the route, recorded reason, and evidence before repeating an action.

SituationWhat it meansNext step
Action-decision route: 503 before the decision is sealedNo new grant was released.Follow the release's retry procedure with the same request and effect key.
Brokered route: 503The provider may have completed the action before AAES Govern failed to save its outcome receipt.Reconcile the recorded decision with the provider's actual result before deciding whether to repeat the identical request.
Federated route: 503 after a sealed decision, from minting or marker failureNo grant material was released, and the live-grant slot remains held.A retry with the same effect-key step is permitted for this failure stage.
403 with a sealed receiptAAES Govern recorded a refusal or failure. The status alone does not establish the provider outcome.Read the reason and reconcile any uncertain result.
Timeout, reset connection, or intermediary errorThe missing response does not establish whether anything was committed or executed.Investigate the records and provider result before retrying.
409A duplicate-effect reason identifies an existing recorded claim, not downstream success. Other state conflicts also use this status.Read the reason; do not create a new effect key to bypass the conflict.

Start reconciliation with GET /v1/receipts?task_id=… and the intent, effect, and effect-id fields returned by the read API. If you need help, give the operator the task ID, effect-key step, and your correlation identifiers so they can find the sealed decision in the journal. A missing receipt does not prove nothing was committed. Remaining retry notes ship with the evaluation package.

Verify offline

Given an export and public key from your evaluation install, run:

aaesverify --export <export.jsonl> --pubkey <key.pub>

No running service is required. See the CLI reference for offline audit commands, or return to the API reference for the daemon contract.