import { z } from "zod"; export declare const PRINCIPALS_VERSION = "agent-safe.principals/1"; export declare const MAX_PRINCIPALS = 200; /** What an operator may do; each control route names the scope it needs. */ export declare const OPERATOR_SCOPES: readonly ["halt", "resume", "secrets.reload", "status", "metrics", "evidence", "cards.authorize", "escalations.resume"]; export type OperatorScope = (typeof OPERATOR_SCOPES)[number]; /** * How a principal proves itself. The file holds identities and digests, * never a token: a bearer credential is the SHA-256 of the token, a client * certificate is named by its SAN URI and optionally pinned by fingerprint, * and a workload token is named by issuer and subject. */ export declare const PrincipalCredentialSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"MTLS">; san_uri: z.ZodString; cert_fingerprint_sha256: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"WORKLOAD_JWT">; issuer: z.ZodString; subject: z.ZodString; audience: z.ZodOptional; required_claims: z.ZodOptional>>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"BEARER">; token_sha256: z.ZodString; }, z.core.$strict>], "kind">; export declare const ProposerSchema: z.ZodObject<{ role: z.ZodLiteral<"PROPOSER">; tenant_id: z.ZodString; actor: z.ZodObject<{ id: z.ZodString; type: z.ZodString; runtime: z.ZodOptional; }, z.core.$strict>; allowed_actions: z.ZodArray; id: z.ZodString; credential: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"MTLS">; san_uri: z.ZodString; cert_fingerprint_sha256: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"WORKLOAD_JWT">; issuer: z.ZodString; subject: z.ZodString; audience: z.ZodOptional; required_claims: z.ZodOptional>>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"BEARER">; token_sha256: z.ZodString; }, z.core.$strict>], "kind">; rate_limit: z.ZodOptional; }, z.core.$strict>; export declare const OperatorSchema: z.ZodObject<{ role: z.ZodLiteral<"OPERATOR">; scopes: z.ZodArray>; id: z.ZodString; credential: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"MTLS">; san_uri: z.ZodString; cert_fingerprint_sha256: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"WORKLOAD_JWT">; issuer: z.ZodString; subject: z.ZodString; audience: z.ZodOptional; required_claims: z.ZodOptional>>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"BEARER">; token_sha256: z.ZodString; }, z.core.$strict>], "kind">; rate_limit: z.ZodOptional; }, z.core.$strict>; export declare const PrincipalsFileSchema: z.ZodObject<{ version: z.ZodLiteral<"agent-safe.principals/1">; principals: z.ZodArray; tenant_id: z.ZodString; actor: z.ZodObject<{ id: z.ZodString; type: z.ZodString; runtime: z.ZodOptional; }, z.core.$strict>; allowed_actions: z.ZodArray; id: z.ZodString; credential: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"MTLS">; san_uri: z.ZodString; cert_fingerprint_sha256: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"WORKLOAD_JWT">; issuer: z.ZodString; subject: z.ZodString; audience: z.ZodOptional; required_claims: z.ZodOptional>>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"BEARER">; token_sha256: z.ZodString; }, z.core.$strict>], "kind">; rate_limit: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ role: z.ZodLiteral<"OPERATOR">; scopes: z.ZodArray>; id: z.ZodString; credential: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"MTLS">; san_uri: z.ZodString; cert_fingerprint_sha256: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"WORKLOAD_JWT">; issuer: z.ZodString; subject: z.ZodString; audience: z.ZodOptional; required_claims: z.ZodOptional>>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"BEARER">; token_sha256: z.ZodString; }, z.core.$strict>], "kind">; rate_limit: z.ZodOptional; }, z.core.$strict>], "role">>; }, z.core.$strict>; export type PrincipalEntry = z.infer["principals"][number]; export type PrincipalCredentialEntry = z.infer; /** A refusal to load principals: the code and the entry or path it concerns, never a value. */ export declare class PrincipalsError extends Error { readonly code: string; readonly subject: string | null; constructor(code: string, subject?: string | null); } /** The identity a credential asserts; two principals may never share one. */ export declare function credentialIdentity(credential: PrincipalCredentialEntry): string; /** * Parses and checks a principals file: the schema, then no duplicate id and * no credential identity claimed twice. What it cannot check here, that * every allowed action is registered and every credential kind has what it * needs, the registry checks when it is built. */ export declare function parsePrincipalsFile(text: string): readonly PrincipalEntry[]; //# sourceMappingURL=PrincipalsFile.d.ts.map