/** * Governance metadata surfaced from Keel response headers. * * Keel stamps every governed response with decision metadata in `x-keel-*` * response headers (see `app/main.py::_set_keel_decision_headers` in keel-api). * The SDK parses those headers and attaches them to the returned body under a * non-enumerable `_keel` property, so the permit id is reachable without a * second API call and without changing how the body serializes or compares. */ export interface KeelGovernance { /** Id of the AI Permit that authorized or refused this call, when Keel issued one. */ permitId?: string; /** `allow`, `deny`, `challenge`, or `throttle`. */ decision?: string; /** Stable reason string for the decision. */ reason?: string; /** Which component produced the decision. */ decisionSource?: string; /** Keel's request id — quote this in support requests. */ requestId?: string; } /** A response body that also carries Keel governance metadata. */ export type WithKeelGovernance = T & { readonly _keel: KeelGovernance; }; export declare function governanceFromHeaders(headers: Headers): KeelGovernance; /** * Attach governance metadata to a decoded JSON body. * * The property is non-enumerable so `JSON.stringify`, `Object.keys`, spread, * and deep-equality checks on the payload are unaffected. Non-object bodies * (arrays of primitives, scalars, null) are returned unchanged because there is * nowhere safe to attach the property. */ export declare function attachGovernance(payload: T, headers: Headers): T; /** Read governance metadata off a response body, if the SDK attached any. */ export declare function keelGovernanceOf(payload: unknown): KeelGovernance | undefined;