Skip to content

Contracts, endpoints, and configuration reference ​

Use this reference to look up service contracts, selected owner endpoints, and their implementation boundaries. A route described here may be source-only or conditionally mapped; read each section's status before treating a contract as deployed.

For the public Gateway route inventory, see the HTTP API reference. To configure a provider, follow Configure providers. For runtime settings and deployment configuration, see Runtime configuration.

The checked-in release/Kustomize composition still includes MCP compatibility image, workload and ingress resources. Their presence does not make MCP a supported product or acceptance surface. Supported client paths are Gateway/API, browser and native .NET CLI. Outbound remote MCP connections are separate.

Project role display ​

The Projects & Config owner includes effectiveRoles in every ProjectSummary response. Each entry contains resourceType (tenant or project), resourceId, and role (tenantAdmin, owner, contributor, viewer, or orchestrator). Project roles apply only to the summary's project; tenant roles apply only within the caller's selected tenant. The owner returns current roles for the caller, not assignments held by another actor.

The Web client uses these values to label project tiles and headers. The role labels do not authorize actions or replace permission checks. Every protected operation continues to check current owner authority.

Model-provider Draft metadata ​

GET /api/v1/platform/byok-deployment-bindings reads the responding Projects process's startup copy. It requires an unbound current PlatformAdmin with api.read and projects.admin. The no-store response contains the copy's revision and each BYOK reference, enabled state, and reasoning levels. It returns 503 when the copy is unavailable. The copy is not a deployment-wide inventory and does not report AgentHost readiness.

The public Gateway supports Draft list, read, create, and update operations for platform and project scopes. Every route requires api.read and projects.admin. Platform routes require an unbound current PlatformAdmin. Project routes require the exact project binding, no run binding, and a current project Owner or PlatformAdmin. Projects & Config checks current membership and role assignments before each read or save, including retries. The Web obtains this binding by requesting project_id and omitting run_id. The Broker token carries the exact project claim and projects.admin scope; the claim selects the project but does not grant a role.

Create and update requests contain operationId, expectedRevision, name, type, base_url, and model. Optional fields are wire_api, azure_api_version, reasoning_efforts, prompt_capacity_tokens, rate_card_id, and rate_card_version. The two rate-card fields are a pair. When an update omits both fields, Projects preserves the existing pair. An explicit pair of null values clears the pair. Authorized platform and project reads return the saved pair. Unknown or duplicate fields fail with 400 model_provider_draft_invalid_request. Credential values, headers, and vault references are not accepted. Create requires revision 0; update requires a revision greater than 0. Create derives a stable provider ID from the operation ID.

Platform create also accepts an optional reference. Omit it for an ordinary create. Null, an empty string, a project create with reference, and any update with reference return 400 model_provider_draft_invalid_request. The value must contain 1–256 ASCII letters, digits, ., _, or -. It cannot begin or end with _ or contain __. The response preserves the exact spelling on create, list, read, and update. Other providers omit the field.

Each reference-bearing create also requires targetInstallationId, a nonempty lowercase UUID in canonical D form. Ordinary creates, project creates, and updates reject this field. The owner checks current authority and compares the pin with the Projects database namespace before it reads a receipt. A different pin returns 409 target_installation_mismatch; a missing or unreadable namespace returns 503 model_provider_draft_unavailable.

The authorized target-context read returns this namespace as installationId. See Projects & Config authorization context for the read contract. The read does not authorize a later create.

ProjectsConfig:ProviderReferenceReservationsEnabled defaults to false. When it is off, a new reference-bearing create returns 503 model_provider_draft_unavailable; authorized, namespace-bound replays still return the original create receipt. The local model-binding copy must be available for a new reservation.

Before migration or enabling reference writes, inventory earlier enabled reference writes and their receipts. Fence reference-bearing traffic at the edge and all direct Projects access. Drain in-flight requests and old Projects owners before migration or enabling reference writes. Upgrade every Projects owner, verify grants, namespace, reservations, and routing, and reconcile legacy receipts before releasing the fence. Old owners accept unpinned replays even when new reservations are disabled.

Reservations are permanent and unique under ASCII case folding. A reservation cannot match a provider ID, a hosted binding, or a differently cased local binding or saved selector. An exact BYOK binding is allowed, including when it is disabled. An exact saved selector is allowed only with that exact local BYOK binding. Conflicts return 409 reference_conflict. The check covers the local binding copy and current saved platform and project selectors, including archived projects; it is not a deployment-wide inventory. Database writers use READ COMMITTED for provider and reservation inserts. The insert guards reject REPEATABLE READ and SERIALIZABLE with SQLSTATE 40001 so a stale transaction snapshot cannot bypass a collision check.

For a lost response, retry with the same operation ID and identical input. Current authority and the original issuer, tenant, subject, and installation are required. When the original issuer, tenant, and subject match, a legacy receipt without an installation or a copied receipt from another namespace returns 409 reference_reconciliation_required. A different issuer, tenant, or subject receives the existing conflict response. Reconcile against independent receipt evidence and provider state; do not infer a namespace or use a new operation to bypass reconciliation. A different operation cannot adopt an existing reservation: inspect the list and choose a different reference. A reservation does not select or activate a provider or remove a deployment binding.

Back up the installation identity, provider heads and revisions, reservations, and authority data together. A restore replacing the original keeps the identity; fence the original before serving the replacement. A point-in-time restore can lose accepted creates and receipts. Keep reference writes fenced and reconcile independent receipts and provider state before retrying.

A clone inherits the source identity. Before reference traffic reaches a fork, fence all Gateway and direct Projects traffic and drain in-flight transactions. The privileged owner must take the provider-create advisory transaction lock and assign a fresh UUID in one transaction. Record the original UUID returned by the first SELECT before the UPDATE:

sql
BEGIN;
SELECT pg_catalog.pg_advisory_xact_lock(
    pg_catalog.hashtextextended('agentweaver.projects_config.model_provider_create', 0));
SELECT installation_id FROM projects_config.installation_identity WHERE singleton = true;
UPDATE projects_config.installation_identity
SET installation_id = pg_catalog.gen_random_uuid()
WHERE singleton = true
RETURNING installation_id;
COMMIT;

Compare the UUID returned by the UPDATE with the original UUID. Open the fork only when the UUIDs differ. Copied reservations remain reserved and cannot replay in the new namespace. Never run unfenced copies with the same identity.

The owner requires an absolute HTTPS base_url on port 443. It rejects user information, queries, fragments, IP addresses, and hosts rejected by PlatformEgressHostValidator. Azure URLs must not contain a path. This check does not resolve DNS or approve runtime egress.

A saved row contains id, name, type, base_url, model, wire_api, azure_api_version, reasoning_efforts, prompt_capacity_tokens, scope, nullable projectId, state, revision, and configurationHash. It also contains has_api_key: false, is_active: false, and hasCredential, which is true when the current revision has a published credential version. The response omits the credential version, rate-card references, and audit identities. A save returns the immutable revision written by that operation. An exact retry returns the same revision, including after a later edit.

List requests accept pageSize (default 50, range 1–100) and afterProviderId. The response is { providers, nextAfterProviderId }. Results include Draft and Available providers in the requested scope and use provider-ID order. The Gateway limits save bodies to 32 KiB, single-row responses to 32 KiB, and list responses to 4 MiB. Draft GET routes reject request bodies.

Invalid requests return 400; missing providers return 404; stale revisions, operation conflicts, and unsafe stored URLs return 409. An unsafe stored URL error contains only the provider id and revision, so the caller can repair the Draft with a new operation ID. An edit of an existing Available provider at its current revision returns 503 model_provider_draft_unavailable. Owner responses use Cache-Control: no-store.

The authenticated credential status routes (GET /api/v1/platform/byok-providers/{providerId}/credential and GET /api/v1/projects/{projectId}/byok-providers/{providerId}/credential, routed to Identity Broker) return Cache-Control: no-store and X-Content-Type-Options: nosniff with only scope (platform or project), projectId (string or null), providerId, providerRevision, state (not_set, enabled, disabled, pending, or quarantined), and credentialRevision (0 when absent, >= 1 when a slot exists). Status reads never return keys, vault secret names, or key versions.

The authenticated credential routes (PUT /api/v1/platform/byok-providers/{providerId}/credential and PUT /api/v1/projects/{projectId}/byok-providers/{providerId}/credential, routed to Identity Broker) accept operationId, expectedProviderRevision, expectedCredentialRevision, and exactly one of apiKey (upload or rotate), recoverySecretVersion (recover a quarantined write for the same operationId), or recheckExistingVersion: true (verify the stored, enabled Key Vault version against the current provider revision without uploading a key or creating a new Vault version). Responses include providerState (Draft or Available). When rate_card_id and rate_card_version verify against Events, providerState becomes Available; otherwise the provider stays Draft with the proved key saved. DELETE on the same routes cancels an unfinished operation (cancel: true) or disables the credential and returns the provider to Draft.

Invocation setup receipt ​

The source-only POST /api/v1/p1/invocations/{invocationId}/setup (POST /api/p1/invocations/{invocationId}/setup on Projects & Config) accepts no JSON body or existing project/resource IDs. It uses the current unbound actor token with the existing api.read and projects.admin scopes, explicit tenant selection, and current TenantAdmin authority. It is excluded from MCP.

The runtime invokes the purpose-limited SECURITY DEFINERissue_p1_project function, which atomically creates the project, initial configuration, Owner and Orchestrator assignments, audit events, and immutable ProjectSetupReceipt in the Projects database. Exact retries are bound to the same actor, membership, and TenantAdmin assignment revision and recheck current authority plus setup state. Stale, revoked, reassigned, or cleaned receipts cannot establish new authority. The 200 response contains the receipt only; responses are no-store. Runtime has function EXECUTE rights, not direct access to project_setup_operations.

The endpoint does not issue run, Environment, Sandbox, Pod, or AgentHost creation authorization and does not establish cross-database atomicity. API acceptance tooling is not switched to this operation by this source change. See project setup receipt for the migration, grant-catalog, and operator-command boundaries. A fresh PostgreSQL initialization creates and migrates the Projects schema as its dedicated owner and reconciles the reviewed runtime grants in one transaction; the operator's role-assumption permission is checked before any role creation.

Invocation-bound Environment creation ​

P1InvocationBindingExpectation carries the expected Core and setup invocation IDs, setup receipt hash, accepted-selection hash, root session, and execution fence. These are comparison values, not caller-issued authority. Environment reads the actual current binding from Core using the authenticated actor and retains the owner-generated creation operation and result in its local transaction. A pending generation is not an actual provider reference.

The Environment creation contract describes the source-only boundary, immutable identities, non-enrollment of old resources and remote-read race. The separate creation evidence reads define the authenticated Environment response and bounded root-only Host consumer; native CLI acceptance remains separate. It adds no sign-in flow, live grant, or deployment evidence.

Terminal runtime cleanup ​

The internal version 2 RuntimeRunStartCleanupProjection carries the terminal run state and fence, startup intent ID and version, startup fence, accepted selection, parent root, and saved receipts. It is not caller-issued authority: Orchestrator and Environment revalidate the current authenticated owner and exact resource before retirement. The version 2 receipt can carry the exact Sandbox resource when one is known. A missing or conflicting resource stays pending rather than authorizing a different registration or placement.

For cancelled, the terminal fence must be greater than the startup fence. For completed, failed, or indeterminate, the current terminal fence can equal the startup fence. Active runs and stale projections are rejected. Version 1 remains limited to coordinator-root cancellation and the advanced fence. Retained workspaces are not deleted by this cleanup.

Version 2 requires Orchestrator migration 047 and the enabled accepted_run_terminal_cleanup_guard. A failed or indeterminate run cannot recover after an exact terminal cleanup marker has been committed. Before applying migration 047, roll out guard-aware Orchestrator code, drain older replicas and their in-flight work, and update the compatible Identity and Environment owners. The maintenance runner checks the requested immutable Orchestrator and Environment images in Deployment templates and active Pods; that check does not prove that external in-flight work has drained. Older Orchestrator images reject schema 047. Do not roll back across the migration without a separately reviewed recovery plan.

Caller attention ​

The Orchestrator's UserNotification projects persisted pending coordinator gates and recent backlog plan promotions for the existing bell and attention list. UserNotificationPage contains items, the total matching pending count, and nullable nextCursor. Each item carries notificationId, source, projectId, runId, sessionId, createdAt, and updatedAt. A pendingGate item also carries requestId, kind, prompt, gateKind, and stateVersion. A backlogPromoted item carries promotionId and taskCount, and its gate fields are null. The session-status CoordinationBlockerKind mapping is reused.

GET /api/v1/notifications checks fresh project read authority on both sides of the read. projectId only narrows that authority. includeDismissed=true exposes unresolved shared work even if the caller dismissed its notification. Dismissal is a separate caller record, not a decision. See Read notifications across runs.

Azure public routing ​

The managed Azure Gateway uses one HTTPS listener for the wildcard managed domain. Broker, Web, Gateway API, and MCP compatibility HTTPRoutes attach to that listener with exact hostnames and their existing path and backend rules. The compatibility route does not make MCP a supported product or acceptance surface. This lets a Broker request remain routable when HTTP/2 reuses a Portal connection; an unknown hostname still has no matching route. This topology does not change the authentication or authorization contract of any service.

Provider contract ​

ProviderDescriptor identifies a provider seam and records the provider ID, adapter version, options-schema version, hosting pattern, and advertised capabilities.

ProviderRegistration adds the enabled state, options revision, and selected schema version. A PinnedProviderBinding records the run, resource generation, and negotiated capabilities.

These records contain no credentials or option values. Follow Configure providers to select and configure a provider. See Providers and models for resolver limits.

Customer-provided model-provider draft contract ​

ModelProviderBindingScope is Platform or Project. Contract version 2 of ModelProviderBindingRevision in Agentweaver.Abstractions carries the provider ID, scope and project ID, display name, provider type, HTTPS base URL, deployment, optional wire API and Azure API version, reasoning efforts, optional prompt capacity, provider revision, optional credential-version and rate-card references, and a configuration hash. RateCardId and RateCardVersion are nullable strings. A rate-card version is opaque; callers must not parse or normalize it.

The Projects & Config service stores metadata in a mutable provider head and an append-only revision ledger. New providers start in Draft. Public metadata requests do not accept credentials, headers, vault references, or rate-card references. Credential publication and activation are unavailable. Existing Available revisions and accepted run pins remain readable.

Every method on /internal/byok/credential-publications returns 503 before authentication, body reads, replay, or database access. The response has Cache-Control: no-store and Pragma: no-cache. Except for HEAD, its body is {"code":"credential_publication_unavailable"}. HEAD has no body.

Identity Broker uses the v2 private routes under /internal/byok/credential-publications/v2/ (preflight, publish, cancel, and disable) over the pinned, no-redirect Broker HTTPS channel. Each v2 request verifies current actor membership and role authority in Projects & Config, serializes publish, cancel, and disable under the provider lock, and records durable operation receipts in model_provider_credential_operations. disable clears the active credential reference under the same provider lock used by run selection so new pins fail (422 model_credential_unavailable) while previously accepted pins remain redeemable.

Projects requires each Draft head change and its matching revision in the same PostgreSQL transaction. A new Draft starts at revision 1 without a credential. An edit advances the revision by one and preserves the previous credential version, slot, and secret identifier. Existing Available heads cannot change through this path. An exact authorized Draft retry returns its saved revision; a reused operation ID with changed content returns 409.

The Events owner-read route is private and is not exposed through Gateway. It reads the immutable Events-owned card by its exact string ID and version. The route returns 404 for a missing key and does not write or publish pricing.

Public provider reads and Draft metadata writes still require api.read and projects.admin. Platform calls require an unbound PlatformAdmin request. Project calls require an exact project binding with no run binding and a project Owner or PlatformAdmin. See issue #2635.

The authenticated GET /api/v1/projects/{projectId}/configuration/choices endpoint returns current project-scoped model references, supported reasoning efforts, and platform provider selections for settings. It is a no-store eligibility view, not a provisioning check or live upstream result. When Projects & Config has the read-only model-binding copy, models is available with a bindingsRevision and one choices entry per enabled binding. BYOK entries list their configured reasoningEfforts; hosted entries report recent AgentHost-verified reasoningEfforts with reasoningEffortSource: "hostedModelCatalog" when available. A missing or expired publication falls back to reasoningEffortSource: "verifiedAtRunStart" with no levels. Hosted publications are limited to the current actor, project, connection, and model-binding revision, expire after 24 hours, and cannot replace a newer verification with a delayed older one. The runtime still checks the selected level against its live SDK catalog when a run starts. The v1 vocabulary is none, minimal, low, medium, high, and xhigh; each model entry lists only its configured or verified levels. Without the copy, models is unavailable with reason model_capability_catalog_unavailable and empty choices. In both states, savedReferences is not an eligibility claim. Model eligibility is checked against the runtime binding when a run starts, and accepted run selections remain immutable. Project overrides remain available for model configuration; non-model provider selections are platform-owned. availablePlatformProviders lists platform BYOK providers in Available state (omitting endpoints, credentials, and actor identities) and marks the active platform default with isActive. Run start still enforces project model selection, policy, and egress checks. Writes must send empty providerOverrides and orderedProviderOverrides arrays (non-empty values return 400 project_provider_override_unsupported). Legacy stored values are kept on new revisions but are ignored for new provider resolution.

SessionsCapabilities in Agentweaver.Abstractions defines the shared capability identifiers for Sessions providers. The native PostgreSQL journal advertises SessionsCapabilities.All; other providers may advertise a smaller set, and a provider can be selected only when it satisfies the run's required capabilities.

Native ACS artifact and evaluation contract ​

NativeAcsArtifact in Agentweaver.Abstractions contains the exact manifest, all relative module and data files, and a SHA-256 hash that binds those bytes. The validator checks the complete artifact before it calls the native ACS validator. It rejects manifest inheritance, paths outside the supplied artifact, cyclic YAML aliases, and nesting deeper than 64 levels. NativeAcsEvaluationSnapshot uses the existing SessionIdentity and bounded tenant, agent, and action IDs. A caller may supply the optional NativeAcsVerifiedHumanIdentity only after separate verification. The evaluator treats a missing value as unavailable; it does not verify the identity source or infer identity from the Broker subject, actor ID, or UPN.

NativeAcsEvaluationResult binds the decision to the artifact hash. Invalid artifacts and native runtime failures return an error rather than an allow.

The opt-in composable-domains-v2 snapshot can also contain model_use and guardrails facts. Model-use facts carry the accepted reference, concrete model ID, source mode, provider type and ID, configuration revision, and configuration hash. Guardrails facts carry the UserInput/Text stage, exact ordered check registrations, and normalized findings. Approval facts carry the owner-verified turn ID and exact argument digest. The snapshot does not contain raw prompt bytes, budget facts, or human response text.

The composable-domains-v1 profile adds reviewed actions and platform_network domains to one artifact. It pins the manifest and all three Rego modules. Actions data under data.actions and network data under data.agentweaver stay in separate files. Separate input-fact allowlists restrict the action and network rules; the selector reads only the caller- selected domain_id. The agentweaver_domains_v1 selector invokes only that domain's rule at pre_model_call. Domain changes can update their own data file; they cannot change the manifest or policy modules.

NativeAcsPolicyEvaluator.EvaluateComposedAsync requires a NativeAcsDomainId, and accepts projectScope: true (alongside EvaluateComposedForApprovalAsync and ResolveComposedApprovalAsync) to validate Project-scoped artifacts without policy/data.json while rejecting PlatformNetwork. The existing Validate, EvaluateAsync, and Environment compiler entrypoints keep their single-profile behavior and reject composed artifacts. The Environment candidate compiler has separate composed and System-only entrypoints, and each candidate hash covers the complete artifact. Project validation consumes this profile without runtime admission or a policy write.

Platform artifacts require their complete network data. Project artifacts use the same profile and omit policy/data.json; supplying that file is invalid. The hash covers the exact submitted manifest and files. An empty actions allow-list denies all actions; a missing actions data file is invalid. Project validation does not select or evaluate the Project network domain. Future consumers must select network from the Platform scope and combine applicable scope decisions with hard-deny precedence.

RuntimeNativePolicyGate is the Orchestrator source boundary for the opt-in profile. Production reads current Platform and Project Policy revisions from Projects and retains immutable admission bindings in the owner process. The gate records exact source references and the complete content hash beside request and registration hashes. Verification rechecks all values before native tool approval release. A missing evaluator, Policy source, or admission binding denies the callback.

An escalated finding saves one turn-bound suspension record before the coordinator opens its approval gate. The native ApprovalResolver resolves only the retained PolicyInput and approval handle. Turn ID or argument-digest changes reject the result. The approved retry reissues independent runtime authority, rechecks restrictions at verification, and consumes one exact-turn handoff. Pending-gate collisions do not create a bypass or sibling-turn grant.

Projects & Config exposes the current Platform policy artifact through a source API. It uses one head per scope and keeps the Policy ID of an existing head. Only an empty scope gets the server-owned canonical Policy ID. Each artifact retains the reviewed domain declarations. Scope and domain selection remain server-owned; future consumers evaluate applicable scope/domain policies independently, with hard-deny precedence.

RouteContract
GET /api/v1/policies/platformRead the current artifact and revision from one hash-checked snapshot. Requires api.read, an active membership, an unbound request, and a current PlatformAdmin grant. The owner rechecks authority after the read. The request accepts no query, body, content type, or transfer encoding. Returns 404 when no head exists, 500 for corrupt source, and 503 when the source or authority database is unavailable. Does not require projects.admin.
GET /api/v1/policies/platform/revisions?pageSize={n}&cursor={token}Return bounded revision metadata in descending order. pageSize defaults to 20 and ranges from 1 to 100. The versioned cursor binds the Platform lineage, snapshot revision, page size, and last returned revision. An empty scope returns an empty page with null lineage fields. Each page rechecks current authority.
GET /api/v1/policies/platform/revisions/{revision}Return the exact retained revision, full artifact bytes, verified hash, and original createdAt. The path value must be a canonical positive decimal Int64. No head or a future revision returns 404 native_acs_policy_not_found; a missing committed revision or corrupt source returns 500 native_acs_policy_corrupt.
GET /api/v1/policies/projects?pageSize={n}&cursor={token}List metadata for stored Project Policy heads visible to the caller. Requires api.read, active membership, an unbound request, and current TenantAdmin or project Owner, Contributor, or Viewer authority. pageSize defaults to 20 and ranges from 1 to 100. The opaque protected cursor binds the tenant, caller, current read grants, page size, and last returned Project ID. A membership or grant change makes the server return 400 native_acs_policy_scope_list_request_invalid; the caller restarts the list. Each page uses one bounded query to check current access and read current heads; pages do not form a snapshot.
GET /api/v1/policies/projects/{projectId}Read the current Project Policy artifact. Requires api.read, active membership, and current TenantAdmin or project Owner, Contributor, or Viewer authority. The caller must use an unbound token or a token bound to this project. A missing head returns 404 native_acs_policy_not_found.
GET /api/v1/policies/projects/{projectId}/revisions?pageSize={n}&cursor={token}Return newest-first Project Policy metadata. The versioned cursor binds the Project scope, Policy ID, snapshot revision, page size, and last returned revision. An authorized project with no head returns an empty page with null lineage fields. Each page rechecks access.
GET /api/v1/policies/projects/{projectId}/revisions/{revision}Return the exact retained Project revision, full artifact bytes, verified hash, and original createdAt. The path value must be a canonical positive decimal Int64. No head or a future revision returns 404 native_acs_policy_not_found; a missing committed revision or corrupt source returns 500 native_acs_policy_corrupt.
POST /api/v1/policies/projects/{projectId}/validateValidate the submitted Project artifact. Requires api.read, projects.admin, active membership, an unbound identity, and current project Owner or TenantAdmin authority with WriteProjects. The owner rechecks authority before returning diagnostics. Returns 400 for duplicate or malformed JSON properties, 422 for an invalid artifact, and 503 when validation is busy or a dependency is unavailable. No query is accepted.
PUT /api/v1/policies/projects/{projectId}Create Skills-only revision 1 on a headless Project by consuming its pinned baseline. Requires api.read, projects.admin, active membership, an unbound identity, and current project Owner or TenantAdmin authority with WriteProjects. expectedRevision must be explicitly present and null. New writes are off by default and return 503 native_acs_policy_writes_unavailable until NativeAcsPolicy:ProjectHeadWritesEnabled is true. Exact retries with the same idempotencyKey and request body recover a lost response by returning the saved NativeAcsPolicyWriteReceipt (replayed: true) after current authority checks, bypassing the switch, validator, and admission fence. A non-Skills delta, bad hash, or invalid 12-file v3 profile returns 422 native_acs_policy_invalid; healthy Platform drift, an existing head, or a conflicting idempotency key returns 409; an unavailable or revoked pin returns 503. After 409 Platform drift, revoke the unused pin, obtain fresh human baseline approval, and re-pin before retrying with a fresh key. After a first Project Policy write, recover stale accepted runs using Same-revision Skill recovery. No query is accepted.
POST /api/v1/policies/projects/{projectId}/baseline-approvalsRecord an immutable starting Project Policy approval for a headless Project. Requires api.read, projects.admin, active membership, an unbound aw_actor_class = "human" token, and current project Owner or TenantAdmin authority with WriteProjects. Validates the 12-file v3 Project artifact, verifies ContentSha256 server-side, and binds installation_id and approver revisions. No query is accepted.
POST /api/v1/policies/projects/{projectId}/baseline-approvals/{baselineId}/revokeRevoke an Approved or Pinned Project Policy baseline before consumption using compare-and-swap under the Project policy lock. Requires the same human Project policy author authority. No query is accepted.
POST /api/v1/policies/platform/validateValidate a complete artifact without changing policy state. Uses the same read authorization. A malformed request returns 400. A proven invalid artifact returns 422 native_acs_policy_invalid with diagnostics. An unavailable, crashed, timed-out, or unconfigured native or OPA dependency returns 503 native_acs_dependency_unavailable with a typed dependency value. This includes the native validator codes opa_timeout, opa_invalid_executable, opa_execution_error, rego_staging_error, and validation_internal_error. Other native validator diagnostics return 422.
PUT /api/v1/policies/platformPublished in Gateway OpenAPI with the Platform-only PlatformNativeAcsPolicyWriteRequest schema while Project Policy writes preserve the strict NativeAcsPolicyWriteRequest schema. Validate and store an immutable pending preparation against expectedRevision, or pass preparationId to commit a prepared Platform Policy or replay an already-committed write. Requires api.read, projects.admin, an active membership, an unbound request, and a current PlatformAdmin grant with WritePlatformRuntimeDefaults. Unmapped fields such as caller-supplied targets or proofs return 400. New writes are off by default and return 503 native_acs_policy_writes_unavailable until NativeAcsPolicy:HeadWritesEnabled is true; continuation commits with preparationId also require NativeAcsPolicy:GuardedPlatformCommitEnabled to be true. A successful preparation returns a pending NativeAcsPolicyPreparationReceipt; a committed or replayed continuation returns NativeAcsPolicyWriteReceipt. Non-provider pending preparation retries return the saved preparation receipt after current authority and head checks. Optional providerHostRequest binds a new preparation to one delivered model provider host request (requestId, providerId, providerRevision, host, port), requires an existing Platform Policy network baseline, verifies current provider revision and preserved other Policy rules, and includes the binding in idempotency checks; exact providerHostRequest retries return the saved preparation receipt after checking current authority and the operation digest even if the Policy head or provider revision changed. Continuation commits execute atomically through projects_config.commit_guarded_platform_policy against the enrolled target registry and complete Environment proof receipts, recording an Approved governance decision and retiring active claims. Authorized provider and platform egress queue reads project exact requestId and approvalStatus (pending, accepted, or unavailable) from saved preparations and matching committed Policy revisions, keeping recorded delivery failures separate and omitting preparationId and policyRevision on Project reads. A missing baseline, uninitialized or stale enrollment, incomplete proof, stale head, stale provider request, or conflicting idempotency key returns 409. A preparation does not activate a Platform Policy revision.

Current and exact-revision reads return the exact manifest and file bytes only after the store verifies the artifact hash. History returns metadata only; its stored hashes do not verify each artifact. Platform reads require an unbound request and current PlatformAdmin authority. Project list requests also require an unbound request. A Project-specific read accepts an unbound request or a token bound to that exact Project. Run-bound and purpose-bound tokens are rejected. PlatformAdmin alone grants no Project Policy access. Project reads require current TenantAdmin authority for the selected tenant or a project Owner, Contributor, or Viewer grant. The owner checks authority in the single bounded list-page query and before and after other Project Policy reads. History query keys are limited to pageSize and cursor; an exact revision accepts no query values.

Project listing includes only projects with stored Policy heads visible to the caller. It does not expose Platform Policy or an inherited Policy view. The list cursor is not an access grant or a cross-page snapshot. If membership or read grants change, the server rejects the cursor and the caller restarts the list. The cursor does not expose Project IDs as clear text.

Project validation reads no Policy head and writes no Policy record. It checks the submitted profile and hash, not the current Platform policy or effective permission. A successful response is not a grant or an activation. See Validate a Project Policy artifact for artifact construction and submission.

A successful new PUT stores the expected head ID, revision and hash, the full proposed artifact and hash, the actor-scoped idempotency data, and creation time, and atomically appends a redacted platform.policy.preparation.v1 governance decision record (governanceDecisionId and governanceDecisionHash) in the same serializable transaction. It returns state: "pending" and checkpoint: null. It does not update the canonical head, revisions, committed-write receipts, audit, or policy outbox. The store checks current authority and head state in a serializable transaction, then rechecks authority before commit. An exact retry returns the same preparation only while the caller remains authorized and the expected head is current. If the head moves, use a new request and idempotency key. Retries of older committed writes still return their committed receipt after a current authority check. The private Environment source returns committed artifacts only; it does not read preparations.

All responses use Cache-Control: no-store; the Gateway applies a 5 MiB request and response limit and returns 413 for an oversized body. The Gateway rejects undeclared query keys on history and exact-revision routes before owner dispatch. Those two routes do not forward Idempotency-Key or If-Match. The Gateway does not expose these routes through MCP. New validations and writes share a six-request-per-actor, per-minute limit and one active validation slot per Projects & Config process. A busy process returns 503 with retry guidance. These are source-level limits; they do not prove deployed capacity.

Private Environment Policy source read ​

GET /internal/policy-source/platform, GET /internal/policy-source/platform/approved/v1, and GET /internal/policy-source/platform/preparations/{preparationId} share the existing Projects & Config HTTPS listener, normally port 8443. GET /internal/policy-source/platform and GET /internal/policy-source/platform/approved/v1 are mapped when ProjectsConfig:PolicySource:Enabled is true. GET /internal/policy-source/platform/preparations/{preparationId} is mapped only when ProjectsConfig:PolicySource:Enabled is true and ProjectsConfig:PolicySource:PreparationWorkerPins is configured. Neither route is exposed through the public Gateway, OpenAPI, or MCP surfaces.

The shared handshake uses optional client certificates and requires native TLS 1.2 or TLS 1.3. Projects binds each route to its own peer identity and checks that peer before lookup and after serialization before sending headers, including protected errors. Failed TLS validation ends the handshake; a failed per-request check returns 403 policy_source_peer_denied. Bearer tokens do not authenticate either route.

  • GET /internal/policy-source/platform requires the Environment certificate (or head-worker certificate): a current pinned leaf in EnvironmentPins or HeadWorkerPins, exact matching DNS SAN, client-authentication EKU, valid dates, the single pinned backend CA, and valid online revocation status. It returns the current Platform head, complete artifact, stored hash, revision, update time, and admission: { state: "pending", checkpoint: null }.
  • GET /internal/policy-source/platform/approved/v1 requires the Environment certificate in EnvironmentPins only (never head-worker or preparation-worker certificates). In one read-only RepeatableRead transaction, it reads the bounded Platform head and verifies a matching platform.policy.commit.v1 governance approval (Approve / Approved) for the exact policy ID, revision, and SHA-256. It returns the artifact with admission: { state: "approved", receiptId, epoch } from the verified decision's OwnerReceiptId and OwnerReceiptPosition, or 409 native_acs_policy_not_approved when unapproved.
  • GET /internal/policy-source/platform/preparations/{preparationId} requires the Policy worker certificate: a current pinned leaf in PreparationWorkerPins, exact environment-platform-egress-writer.agentweaver.svc.cluster.local DNS SAN, client-authentication EKU, valid dates, the single pinned backend CA, and valid online revocation status. It requires a nonzero, hyphenated UUID in the path and returns artifact, proposedContentSha256, and expectedHead (policyId, revision, and contentSha256, or null) for that exact immutable Platform/default preparation row, with no actor, governance, or status fields. It never falls back to the current head.

Peer validation precedes the authorization-header check, then the method check, then query and body checks. Both routes accept no Authorization header, query string (including a bare ?) or request body, and read source without calling OPA or changing policy state. Each read uses one read-only PostgreSQL RepeatableRead transaction, checks storage limits before returning bytes, and recomputes the canonical artifact digest against both the artifact's declared digest and the stored row digest. The source limits are a 65,536-byte manifest, at most 64 files, at most 262,144 bytes per file, and 1,048,576 artifact bytes in total. The serialized response limit is 5,242,880 bytes. The request deadline is 15 seconds.

ResultContract
400 policy_source_request_invalidThe authenticated peer sends an authorization header, query, body, or malformed preparationId.
403 policy_source_peer_deniedThe native TLS peer does not match the route's required identity, including a missing certificate, cross-route certificate, or failed final recheck.
404 native_acs_policy_not_foundThe Platform scope has no policy head, or no Platform/default preparation exists at preparationId.
404 not_foundThe request uses an absent preparationId segment, an unconfigured preparation route, a source path variant, or the wrong physical listener.
405, Allow: GETAfter peer and authorization-header checks, the request uses a method other than GET.
500 native_acs_policy_corruptThe stored source exceeds a limit or fails its integrity check.
500 policy_source_internal_errorThe request deadline expires or an unexpected internal error occurs.
503 native_acs_policy_source_unavailablePostgreSQL is unavailable.

Every source HTTP response uses Cache-Control: no-store; unrelated routes retain their existing headers. Missing certificates complete TLS but receive 403 on the source route. AgentHost certificates grant no source access, and Environment certificates grant no AgentHost publication access. Client disconnects produce no response. Runtime pin values and leaf rotation are described in the runtime configuration reference.

If ACS_OPA_PATH is not set to an absolute path, Projects & Config still starts. Policy validation and writes then return 503 with dependency opa.

The head uniqueness migration stops when a scope has more than one head. The error names each affected scope and its policy IDs. The migration changes no record; recovery needs a separate reviewed plan.

The API does not activate the stored policy, migrate v4 data, or change the deployed v4 Policy path. It does not yet expose project-scope policy routes. The testing guide describes the source tests. The ACS runtime asset guide describes the pinned package and OPA assets.

Governance decision history reads ​

GET /api/v1/policies/platform/decisions and GET /api/v1/policies/projects/{projectId}/decisions return newest-first redacted governance decision pages (Cache-Control: no-store) for one (resourceType, resourceId) stream.

  • Query parameters: resourceType (required, 1–64 chars), resourceId (required, 1–256 chars), pageSize (optional, 1–100, default 20), beforeSequence (optional, positive Int64), and on Platform reads only, requestId (optional UUID) and preparationId (optional UUID). Unknown or repeated query keys and GET request bodies return 400 governance_decision_history_request_invalid.
  • Authorization: Platform reads require api.read, an unbound token, and current PlatformAdmin authority (403 otherwise). Project reads require api.read, an unbound or exact projectId-bound token, and current TenantAdmin or project Owner, Contributor, or Viewer authority (403 for missing scope, wrong binding, or revoked tenant; 404 for missing, cross-tenant, or unauthorized projects). Both routes recheck authority after reading PostgreSQL.
  • Integrity and failures: Page reads validate canonical JSON, recorded_at, sequence-1 genesis, and adjacent-row hash links within the returned page (500 governance_decision_corrupt on mismatch; 503 governance_decision_source_unavailable on database or timeout failures). Page reads do not verify the full cross-page chain or a retained checkpoint, and SHA-256 digests are not signatures.

Current Environment egress verification ​

POST /api/network-egress/verify is a read-only Environment owner request. It accepts RuntimeEgressVerificationRequest with contract version, the complete Environment lifecycle fence, the policy generation, and the caller's expected authorized run-selection contextRevision. The existing caller bearer and optional tenant selector are forwarded to Environment; the request does not create or update policy state.

Environment checks current project-write and run-selection authority, confirms the requested fence and latest owner-recorded policy generation, compiles the fresh selection, and reads back the matching policy. It rechecks authority and selection after that read. A successful RuntimeEgressVerificationResponse contains a receipt bound to the complete fence, policy generation, contextRevision, and nonempty policy intentHash. Orchestrator rejects a receipt whose owner, generation, or selection revision differs from its request. This receipt is evidence of policy-object verification only; it does not prove datapath enforcement, authorize a live action, or dispatch a run.

The response fails closed with distinct codes for a missing Environment, stale lifecycle fence, unverified policy generation, changed authorization, changed selection, and unavailable Environment or authorization dependency. These outcomes are not interchangeable with an empty or cached success.

ProviderMeterSourceSelection maps an explicit source to one enabled Cost provider. CostProviderResolutionRequest requires an exact adapter version, options schema and capability set. ResolveCost returns a checked CostProviderResolution candidate, not a live resource or pricing result.

Projects & Config loads optional ProjectsConfig:ProviderCatalog:MeterSourceSelections entries containing MeterSource and ProviderId. Native PUT /api/projects/{projectId}/runs/{runId}/selection accepts a Cost ProviderRequirement.MeterSource; native selection GET returns that key in the stored EffectiveProviderSelection. Both retain current owner authorization. No new usage-writing endpoint, model-source authority, or pricing API is introduced.

Casting proposals and transfers ​

The Gateway exposes the existing Projects & Config casting contracts under /api/v1. See the API reference for routes and Projects & Config for the owner transaction boundary.

ContractFields and behavior
CreateProjectCastingProposalRequestexpectedConfigurationRevision, complete draft.
CreateScenarioProjectCastingProposalRequestexpectedConfigurationRevision, catalog templateId, optional supported universe.
CreateManualProjectCastingProposalRequestexpectedConfigurationRevision, non-empty catalog roleIds, optional supported universe.
FormulateCastingProposalRequestexpectedConfigurationRevision, runId, sessionId, idempotencyKey, canonical prompt, required goal, teamSize (2–10), intent, preferredRoleIds, and optional universe. Uses separate run-bound and unbound project-writer bearers at the Gateway.
AnalyzeCastingProposalRequestThe same run, revision, prompt, team-size, intent, and universe fields as Formulate, without goal; the prompt requests read-only repository analysis.
UpdateProjectCastingProposalRequestexpectedDraftRevision, replacement draft.
UpdateProjectCastingProposalMemberRoleRequestexpectedDraftRevision, catalog roleId, optional customRoleTitle; edits only the proposal draft.
TransitionProjectCastingProposalRequestexpectedDraftRevision for confirm or reject.
ProjectCastingProposalproposalId, projectId, baseConfigurationRevision, draftRevision, state (pending, confirmed, or rejected), draft, nullable generation mode and state, nullable confirmedConfigurationRevision, nullable result, nullable transferProvenance, and creation/update actor IDs and timestamps.
ProjectCastingTransferformatVersion (1), sourceProjectId, sourceConfigurationRevision, agentCharters, casting, contentDigest. Contains no unrelated project settings.
ProjectCastingTransferProvenanceVerified transfer format, source project/revision, and content digest retained on an imported proposal.
ImportProjectCastingTransferRequestTarget expectedConfigurationRevision and transfer; creates a pending proposal. Request body limit is 1 MiB at Gateway and owner.
ProjectCastingTemplateDefinitionid, title, description, roleIds.
ProjectCastingRoleDefinitionid, title, summary, responsibilities, boundaries.

The owner rejects unknown request fields and preserves revision conflicts as 409. A selected universe is validated against the server catalog and remains inside the revision-bound proposal draft. The Gateway publishes these schemas in GET /openapi/v1.json, and the web contract module supplies types only. Generated proposals remain pending until the existing confirmation operation rechecks the writer's authority and both revision fences. No generated request writes live configuration, and no new casting permission or idempotency header is introduced.

Cost and usage storage contracts ​

CostBinding records the meter source, provider identity, adapter version, configuration revision, resource generation, negotiated capabilities, and immutable CostRateCard. PinCost rejects changed candidate configuration. VerifyCost rejects unavailable or changed provider identity. The adapter verifies the resource generation and rate-card content.

ICostProvider.Price returns an amount, unit, rate card, and CostDisposition. Quote requires an explicit provider-supported basis. The Copilot adapter prices input, cached-input, cache-write, and output tokens from its immutable provider- published rate-card snapshot, which records its source and retrieval date. Missing rates or measurements return Unpriced with a reason and no amount. That status does not block admission; unpriced usage remains visible and is excluded from credit-limit totals. These methods do not authorize a model session or caller. The standalone Azure Cost adapter uses an explicitly configured, versioned card for model-scoped standard input/output token rates in the declared currency. It does not fetch rates or quote BYOK work. Missing token counts, unsupported cache categories, unknown models, and changed bindings remain Unpriced.

RuntimeUsageSourceReceiptContract.RequireTrustedAzureByok is the trusted Azure BYOK producer contract. It accepts only an owner-issued receipt that passes Validate and has all of these facts:

  • The registration uses BYOK, and its model binding pin has provider type azure.
  • The SDK source reports provider type azure, the byok.tokens meter, and no hosted multiplier.
  • The SDK deployment ID, the usage model ID, and the pinned model ID are equal.
  • The SDK configuration hash equals the pinned configuration hash.
  • The usage carries its dispatch message ID.

The contract returns TrustedAzureByokUsage, which records the receipt ID, runtime instance, registration revision, dispatch ID, deployment ID, pinned configuration revision and hash, and receipt payload hash.

RuntimeUsageSourceReceiptContract.RequireAzureByokProvenance applies the same source checks without the dispatch message ID. Events applies this check to every receipt that claims Azure BYOK and rejects a failed claim with runtime_byok_azure_provenance_invalid. Usage from an untrusted producer never enters the ledger. Native SDK usage that has no dispatch message ID passes this check and is recorded as Unpriced. Only usage that passes RequireTrustedAzureByok can be priced. Azure pricing is off until EventsAndSessions:Cost:Azure supplies an explicit rate card; until then admitted Azure BYOK usage is recorded as Unpriced. Non-Azure BYOK usage is Unpriced with byok-provider-unpriced. Provisioned-throughput usage stays Unpriced per event. AzureProvisionedThroughputAllocator.Allocate returns a report-only allocation of a fixed period charge whose shares add up to the charge exactly.

UsageSpendEvidenceContract defines the represented-spend read. A UsageSpendEvidenceRequest names one meter source and unit, an optional UsageSpendPeriod (inclusive start, exclusive end), and at most 64 unique, lowercase dispatch GUIDs. UsageSpendEvidence returns UsageSpendTotal values for the run and the period, one dispatch witness per requested dispatch, and an AccountingCursor that never decreases between reads. Every witness watermark equals the cursor. Events never reports SourceComplete; callers compare witness receipts with their own completion manifest. ValidateEvidence rejects any response that does not match its request.

A request can also name an AgentId. The evidence then includes an Agent total for that agent in the run. Dispatch witnesses match dispatches from any run in the project, because project budgets hold exposure for other runs.

SpendBudgetContract defines spend budgets. A SpendBudget has a BudgetId, a Revision, a Scope (project, run, or agent), a meter source and unit, an optional SoftLimit, an optional HardLimit, and a positive ReservePerDispatch. Agent budgets name an AgentId. Project budgets name an explicit Period with an inclusive start and exclusive end. The soft limit can't exceed the hard limit, and one configuration layer can't have two budgets for the same bucket. CurrentProjectSpendBudgets returns the current project budgets with the project and platform revisions that produced them.

Gateway API and server-sent events ​

Project reporting uses two separate owner contracts. ProjectMetrics returns current active and blocked counts, lifetime accepted runs, bounded created and terminal-completed counts, succeeded runs, and zero-filled UTC daily points. ProjectUsage returns ledger measurements grouped by model ID and agent ID. The Gateway never aggregates across owners. Cross-project overview is out of scope. See Project metrics and usage for the field definitions and 0.x dashboard mapping.

Both contracts echo normalized from and to bounds. The half-open interval defaults to the last 30 days and cannot exceed 92 days. Only metrics accepts bucket=day. Both owners validate fresh project read authority, return Cache-Control: no-store, and narrow run-bound tokens to their own run. OpenAPI defines strict response objects and query schemas. Invalid or repeated query values return a 400 problem response with title and code set to query_invalid, without exception text.

Usage measurements remain nullable when source data is missing. Cost subtotals are grouped by unit and disposition; consumers must not add different units or treat unpriced usage as zero. The read path does not invoke pricing or budgeting.

The Agentweaver.Gateway source exposes a finite, versioned client API at /api/v1. The service is a source candidate; these mappings do not confirm a deployment. GET /openapi/v1.json returns the route catalog and identifies each owning service. Protected routes validate the Identity Broker access token for the configured HTTPS issuer and Gateway audience, then forward that token and the optional X-Agentweaver-Tenant selector to the owner. The Gateway does not infer identity or roles from request data, accept arbitrary upstream URLs, or replace the owner's current authorization checks.

Owner response statuses and bodies are preserved, including 409 conflicts and 202 Accepted. A 202 is an owner acceptance only; it does not prove that work completed. Unavailable, redirected, or contract-invalid owner calls produce a Gateway 502; the finite owner timeout produces 504. The live OpenAPI document describes server-sent events (SSE) as text/event-stream; an invalid cursor returns 400.

Method and pathContract
GET /openapi/v1.jsonAnonymous live OpenAPI 3.1 route and error discovery.
GET /agents/agentweaver.agent.mdAnonymous text/markdown; charset=utf-8 download of the operator agent definition embedded in the Gateway. It is excluded from OpenAPI, so it is not an MCP tool, and it calls no owner.
GET /api/v1/authorization/contextFresh no-store Projects & Config context for the validated Broker bearer and optional tenant selector; no query parameters. The context is informational, not an authorization grant.
GET /api/v1/authorization/target-contextAuthorized Projects database namespace ID and fresh effective authority for an unbound current PlatformAdmin.
GET /api/v1/projects/{projectId}/runs/{runId}/eventsBounded replay from the committed Events journal. The owner remains responsible for current run authorization.
GET /api/v1/projects/{projectId}/runs/{runId}/events/liveSSE fan-out from committed Events pages. The Gateway rechecks exact run-bound ReadProjects authority before writing each event; each id is the Events journal cursor and is accepted on reconnect through Last-Event-ID or cursor.
GET /api/v1/projects/{projectId}/runs/{runId}/backlog/promotions/preview?rootSessionId={rootSessionId} and POST /api/v1/projects/{projectId}/runs/{runId}/backlog/promotionsOrchestrator-owned confirmed work-plan preview and promotion. Both require current Coordination authority and the accepted run selection. These Gateway routes are not MCP tools; see Plan promotion and task origin.
Other /api/v1 routesExplicit routes in the live OpenAPI catalog delegate to Projects & Config, Orchestrator, Knowledge, or Events; no generic pass-through exists.

The context route delegates to the existing Projects & Config GET /api/authorization/context contract using the same validated bearer and, when explicitly supplied, the owner-validated X-Agentweaver-Tenant selector. The owner requires api.read and a non-purpose token. The response identifies the actor, current tenant and membership revision, optional project/run bindings, and effective authority; the Gateway validates the exact versioned JSON response and marks it Cache-Control: no-store. This context does not authorize later operations. The retained Web client forwards the selector only on routes included in the allow list: Projects/configuration, run Coordination, Knowledge, run Selection/Usage, and finite journal replay. Live SSE and unrelated calls remain selector-free. GitHub Repo App and ordinary Identity Broker browser calls remain selector-free; Copilot user-connection BFF lifecycle calls forward only the optional explicit tenant selector to their owning Broker.

The Gateway requires HTTPS Identity:Issuer, Identity:Audience, and HTTPS service-root addresses for Gateway:Owners:Projects, Gateway:Owners:Orchestrator, Gateway:Owners:Knowledge, Gateway:Owners:Events, and Gateway:Owners:IdentityBrokerAddress. The optional Gateway:OwnerRequestTimeoutSeconds ranges from 1 to 120 seconds and defaults to 15. See Runtime configuration for deployment configuration guidance.

GitHub Repo App and Copilot connection BFF ​

These explicit Gateway-to-Identity Broker routes are outside the OpenAPI catalog and describe source mappings, not deployment availability. Repository App and Copilot connection operations depend on their Identity Broker handlers. Missing owner routes/configuration remain explicit failures. User-level authorization, status, refresh, and revoke BFF routes use the current Broker bearer and no tenant selector. The status response exposes only connected, githubLogin, and the stable opaque Identity connectionId. Provider tokens and permission grants remain owner-held. Repository discovery and selection are direct Identity Broker browser operations, not Gateway BFF routes; the listing includes installation and repository IDs for the authenticated browser to select.

Method and pathContract
POST /api/auth/github/repo-app/authorizationsBegin user OAuth with optional returnRouteKey for a route on the allow list; returns authorizationUrl, transactionId, and expiresAt.
GET /api/auth/github/repo-app/authorization/statusRead { connected, githubLogin, connectionId }.
GET /api/auth/github/repo-app/authorizations/{transactionId}Read the transaction's { status }.
POST /api/auth/github/repo-app/authorization/refresh / DELETE /api/auth/github/repo-app/authorizationRefresh or revoke owner-held user authorization; no token payload.
GET /auth/github/repo-app/callbackBearerless OAuth callback; only code, state, and error are forwarded with the exact transaction cookie.
GET /auth/github/repo-app/installation/callbackBearerless installation callback; only installation_id, setup_action, and state are forwarded with the exact transaction cookie.
POST /api/connections/copilot-user/v1/{begin,complete,refresh,revoke} / GET /api/connections/copilot-user/v1/{connectionId}Copilot user-connection lifecycle; forwards the unchanged bearer and optional explicit tenant selector, and complete forwards only the exact __Host-agentweaver-copilot-link cookie.
POST /api/connections/remote-mcp/v1/register / GET /api/connections/remote-mcp/v1/{connectionId}Register a Remote MCP OAuth binding or read its redacted status; forwards the current bearer and optional explicit tenant selector.
POST /api/connections/remote-mcp/v1/{connectionId}/consentPrepare metadata-checked consent and return the provider authorization URI. The current source has no project settings flow that starts this request.
POST /api/connections/remote-mcp/v1/callbackResolve the pending connection from callback state, then forward either { state, code } or { state, error: "access_denied" } with the current bearer; token values are never returned to Web.
POST /api/connections/remote-mcp/v1/{connectionId}/refreshRefresh an authorized connection using expected connection, credential, and configuration revisions; an uncertain provider result returns 503 remote_mcp_oauth_refresh_uncertain, becomes indeterminate, and cannot be retried blindly.
POST /api/connections/remote-mcp/v1/{connectionId}/validityCheck that the caller's delegated credential is valid now for an expected configuration revision and checksum. Returns RemoteMcpCredentialValidity with revisions, a denial reason, and the access token expiry; never token values or secret references.
POST /api/connections/remote-mcp/v1/{connectionId}/disconnectClear Identity's protected token references after current binding and revision checks; provider revocation is not yet wired.

The browser lists repositories at GET /auth/github/repo-app/repositories. It gets an antiforgery token from GET /auth/github/repo-app/csrf, then posts the selected installationId and repositoryId to /auth/github/repo-app/selection with the local session cookie and X-CSRF-TOKEN. The response contains a short-lived code; the Gateway requires this code for project team sync.

The OAuth and installation callbacks preserve the owner's Location and every Set-Cookie header. Their host-only cookies are __Host-agentweaver-repo-app-auth and __Host-agentweaver-repo-app-install-auth; the browser does not forward an Identity Broker session cookie. The Copilot begin flow uses only __Host-agentweaver-copilot-link. No Gateway token exchange or caller-supplied actor/project/redirect authority is added.

For accepted project configuration, optional sourceControl.authMode is secret or githubApp; older configurations that omit it remain legacy secret mode without rewriting omitted defaults. sourceControl.identityConnectionId is the stable Identity reference for GitHub App mode, and apiSecretReference remains for secret mode only. The existing run-bound POST /api/v1/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/pin accepts an optional { "selectionCode": "..." } body for App mode; omitting the body preserves legacy behavior. Both modes keep the existing SourceControlRepositoryPinView response and 200/202 semantics. The owner matches the opaque code against the accepted repository and stores exact provider IDs server-side.

The browser lifecycle, user-level selection APIs, and callbacks are not in the retained MCP compatibility adapter's catalog. The adapter's source catalog includes run-bound repository operations, which require tenantSelector; this does not make those operations a supported MCP client surface. The Workspace's configured-repository browser uses these Gateway reads:

Method and pathContract
GET /api/v1/projects/{projectId}/source-control/refs?cursor=Lists up to 100 configured-repository branches and tags. Each ref includes its resolved commit SHA and default-branch marker; nextCursor is opaque to callers.
GET /api/v1/projects/{projectId}/source-control/tree?ref={commitSha}Reads a recursive tree pinned to a full commit SHA. Symbolic links and submodules are identified but not viewable. Truncated or oversized trees fail instead of returning partial results.
GET /api/v1/projects/{projectId}/source-control/files/{path}?ref={commitSha}Reads one regular file at that commit. Relative paths reject traversal and encoded path separators; content is limited to 1 MiB. Binary files are identified with null text content.

These requests require the current project read authority and X-Agentweaver-Team-Sync-Selection, a short-lived repository selection code issued by the existing Identity Repo App flow. The owner checks that the code, configured repository, and GitHub App connection match; it obtains only repository contents:read authority and checks the current project authority after the read before returning data. Secret-auth mode does not provide this browser. Responses are no-store; unavailable or revoked authority is not replaced with another repository, credential, or local filesystem read.

Run-produced files are available through the Source Control output-capture operations: capture, list, read, diff, and file. They read pinned, immutable captures; no raw filesystem Gateway proxy is part of this contract.

Retained first-party MCP compatibility adapter ​

The checked-in Agentweaver.Mcp source provides a Model Context Protocol (MCP) Streamable HTTP endpoint at POST /mcp. This compatibility adapter is not a supported product or acceptance surface; the details below describe its source contract only. tools/list reflects only compatible operations and schemas from the served Gateway OpenAPI catalog; tools/call maps to those fixed /api/v1 Gateway routes. It does not accept an owner URL, identity, role, or authorization decision from tool arguments.

RouteContract
POST /mcpNative MCP initialize, tool discovery, and tool calls. Requires an OpenIddict-validated Broker bearer for the MCP audience.
GET /.well-known/oauth-protected-resource[/{audiencePath}]Public RFC 9728 metadata derived from the configured resource audience; identifies that resource and the Broker issuer.

An unauthenticated MCP request returns 401 with a Bearer resource_metadata challenge. The MCP host validates issuer, signature, expiry, and audience before forwarding the unchanged bearer to Gateway. Gateway performs its own audience validation and dispatches the fixed route to the current owner; owner statuses and response bodies are preserved. HTTP failures and owner accepted: false results become MCP tool errors, with the owner response retained. An owner 202 Accepted is not completion evidence.

Tool arguments are checked against the same resolved OpenAPI schemas returned by tools/list before the Gateway is called. Catalog retrieval and tool calls have a 10-second deadline covering response bodies as well as headers; caller cancellation is propagated, and timeout or Gateway unavailability is surfaced as an MCP error.

The MCP host requires HTTPS Identity:Issuer, Identity:Audience, and Gateway:BaseAddress service-root settings. Its tool catalog is fetched from the configured Gateway; callers cannot override this address. See Runtime configuration for deployment settings.

Environment remote MCP connections ​

The Environment source candidate stores owner-authorized remote MCP connection configuration and immutable catalog pins. Its routes use current Projects & Config authority and no-store responses. The exact route list, revision fields, Identity correlation boundary, parser limits, and missing discovery/transport proof are described in Remote MCP connections. See Runtime configuration for runtime settings.

UsageSubmission contains an event ID, occurrence time, attribution, model metadata, and nullable measurements. IUsageLedger.AppendAsync validates and commits the immutable entry and rate card before returning. It returns the original entry for an identical retry and rejects changed event or rate-card content. UsageAccountingReceipt binds the event ID, attribution, canonical SHA-256 hash, price disposition, amount, unit, rate-card version, and commit timestamp. The ledger commits before returning this receipt. A retry returns the original receipt without repricing. This receipt does not authorize an SDK producer. GetRunTotalsAsync returns exact agent totals and separate meter-source/unit amounts. Unknown measurements stay null. Incomplete pricing remains explicit. Native submissions retain TurnId, SdkEventId, and the complete SdkSource snapshot. Cache-read and cache-write measurements remain separate. Native callbacks do not supply a request count, so RequestCount stays null. Optional A2AMessageId and SdkAccounting bind native provenance to the canonical payload. Null metadata does not change historical canonical hashes. Hosted nano_aiu pricing does not require optional accounting identity or credit status. A supplied identity must have valid text, a positive sequence, and the same SDK session. The exact hosted source, meter, and measured units remain required. An unpriced entry keeps run and agent pricing incomplete. BYOK token pricing remains separate from hosted credit status.

RuntimeUsageCostSnapshotRequest carries the admitted registration and actual SDK source. POST /internal/projects/{projectId}/runs/{runId}/usage/copilot-cost-snapshot returns the source hash, existing run-pinned Cost binding, zero-work quote, and Copilot-only totals. Events checks the current signed run authority before committing the pin. The quote uses the actual model and ProviderWeightedNanoAiu basis. It writes no synthetic usage entry, source receipt, or accounting acknowledgment. The same Cost lock protects pricing resolution and the observed totals read. Missing pricing remains Unpriced; an empty ledger has a zero priced subtotal without turning an unpriced quote into a priced zero. Snapshot validation accepts explicit unpriced Copilot quotes and usage, retains their reasons and event counts, and returns only the known priced subtotal. It rejects other meters and non-AIC units. These observed totals do not prove future accounting-source finality. An optional DispatchId and up to 512 RequiredReceipts request an observed accounting join. References must have unique source and event IDs with exact runtime attribution. Hosted-Copilot snapshots also require run and per-agent totals to include every represented receipt; native-turn accounting uses the same check. RepresentedReceipts contains the matching immutable source and ledger receipts. Events checks actual registration, source, platform message, accounting hash, and price under the same transaction. Optional NativeTurn carries the expected recorded native receipt; it is omitted from historical requests. Events verifies it through POST /internal/runtime/turns/recorded, not through caller claims. That authenticated Core read returns the canonical persisted observation only for the current source, registration, owner checkpoint, report hash, and recorded revision. Its transformed native event IDs must equal the required accounting event set. Events reads Core before its Cost transaction and again after releasing the Cost lock. Only verified native evidence permits a null raw platform message ID. Wrong non-null IDs, late events, changed evidence, missing rows, and altered prices still fail. ValidateObservedReceipt allows explicit unpriced accounting. The separate priced validator still rejects unavailable pricing for configured hosted credit admission.

RuntimeUsageSourceReceipt contains the immutable runtime registration, native usage submission, source hash, receipt ID, version, and recorded timestamp. RuntimeUsageSourceReceiptContract validates exact owner, SDK, model, catalog, event, turn, and accepted-selection pins. It rejects changed hashes and Copilot units on BYOK sources. This receipt proves a source observation, not a price or accounting acknowledgment. A stored source receipt remains readable after its original lease expires. That historical read does not authorize another observation.

RuntimeNativeTurnAdmissionReceipt binds a stable platform message to its current registration, SDK source, request hash, prompt hash, and committed owner revision. It contains no predicted native message or turn ID. MaxModelTurns reserves whole-run send capacity when that existing MAF dispatch is prepared. Exact replay consumes no new slot; sending or uncertain work cannot be resent or refunded. This is not a count of internal SDK model API calls. For a recovered prepared child, the immutable dispatch row remains the origin. A verified native-child-rebind receipt can authorize a separate effective binding after the replacement is ready and the recovery hold is released. Ordinary dispatch then uses the saved message and prompt through that binding. Recovery does not send the message or change the origin row. Observation keeps origin fields and reports the optional origin/effective projection separately. RuntimeNativeTurnBeginResult contains exactly one admission or RuntimeNativeCreditDenialReceipt. A hard-limit denial binds the current registration, source, dispatch, checkpoint, measured credits, ledger digest and count, Cost identity, and before/after guard and dispatch revisions. Orchestrator stores it in the existing outbox with the credit-guard update, without a schema migration. POST /internal/runtime/turns/denials/read returns the stored denial for the exact dispatch and stage under current source authorization. At preparation, the existing budget error remains after the denial commits. At native begin, AgentHost receives the typed denial while the dispatch remains prepared at the same owner revision. For hard-capped Hosted Copilot, AgentHost captures the native event-log cursor before begin. After a denial, it accepts only a complete bounded range with zero events and unchanged cursor hashes. RuntimeNativeTurnNoSendReceipt binds that range to the denial, registration, source, and SDK session hash. The Host submits it through POST /internal/runtime/turns/no-send; Orchestrator verifies the persisted denial and unchanged prepared dispatch and stores the evidence in the existing outbox. Only after that receipt is stored does the Host return the budget error. Any event, incomplete range, or changed cursor fails closed; the Host does not call native Send. This evidence does not prove later usage accounting is complete. RuntimeNativeTurnObservation carries actual native IDs, the durable completion range, output hash, observed root usage-event IDs, and an optional accounting checkpoint. RuntimeNativeTurnRecordedReceipt binds that observation hash to the admitted intent. The source writer records it as partial, not source-complete. RuntimeNativeTurnAccountingRequest carries the recorded native proof and exactly its observed usage references. POST /internal/runtime/turns/accounting verifies the existing Events join before completing that dispatch. Core checks the committed report, releases owner locks for the Events request, and rechecks current authority and the same report in its final completion transaction. Report insertion, proof reads, and final completion reject event reuse by another dispatch of the same SDK source. RuntimeNativeTurnAccountingReceipt binds the observation, represented references, and newer owner revision. The source report stays partial; no source-finality or strict retirement proof is written. The Host returns the actual answer after this durable observed completion. MAF verifies real pricing before preparing capped hosted work and repeats it at native begin. After the response, MAF rereads the completed dispatch and exact output hash before retaining a result. Uncapped unpriced output remains available; later usage affects the next capped boundary.

PostgresUsageLedger.AppendWithinTransactionAsync uses the caller's owned PostgreSQL transaction without a separate commit. The trusted Events consumer can commit its source inbox and accounting receipt with the usage entry and rate card. The ordinary AppendAsync method retains its own transaction and commit.

These low-level contracts do not authenticate a remote writer. Migration 006_native_sdk_usage.sql extends the service schema to version 6. It preserves existing history and adds cache-write values and nullable request counts. Migration 007_native_usage_receipts.sql adds the reference consumer's immutable receipts and run Cost bindings in version 7. The optional native HTTP routes separately authenticate the original bearer and require current Core authority. Source writes also require Identity's observe credential. Typed action grants and opaque model references cannot replace this producer boundary.

Orchestrator AGT Policy provider ​

AgtPolicyProviderOptions supplies an opaque resource ID and generation, an options revision and schema version, and one or more platform AGT YAML policy documents. Every platform document must parse, default to deny, and use only allow or deny actions. The provider is enabled as the platform singleton agt.dotnet-yaml; project provider overrides are rejected by the shared resolver.

AgtPolicyEvaluationRequest carries a bounded opaque actor ID and action ID, primitive policy context, and optional project policy documents. Each configured document is evaluated independently; every document in both policy sets must allow, so project policy can only narrow. The adapter returns typed allow, deny, or error evidence plus provider/options metadata; it does not consume grants or authorize effects. The ExecutableActionGuard uses the Orchestrator-owned current-grant lookup and redacted receipt writer. It returns structured deny/error results for missing, stale, mismatched, expired, or unavailable grants and rechecks current authority, grant state, and fence after awaited operations before invoking a protected callback. The Orchestrator receipt writer rechecks the authenticated actor and current acceptRunSelection authority/selection immediately before committing the owner receipt. Allow receipts also require the exact current grant, expiry, and fence; Deny/Error need only an issued grant and do not grant authority. For an Allow, the guard waits for the durable Events & Sessions receipt acknowledgment before the protected callback. Events accepts only the immutable receipt reference. It revalidates current owner admission inside the journal transaction and returns a no-store acknowledgment. Downstream protected-effect call sites are not claimed. Caller bindings require one authenticated identity whose sub, project_id, and run_id claims share one validated HTTPS issuer. The current grant descriptor must match that issuer and subject; a missing, duplicate, or cross-issuer binding is denied before protected effects. The owner resolves fresh tenant membership and current grant authority; a tenant claim is not required.

Orchestrator coordination owner ​

The Agentweaver.Orchestrator is an unpublished .NET 10 host candidate. Protected coordination routes require an OpenIddict-validated bearer with one authenticated GUID sub, one project/run binding, api.read and projects.orchestrator scopes, and the route's configured audience. Each operation also revalidates current Projects & Config authority and the accepted run selection; the caller's claims alone do not establish current permission. Internal Events calls use the configured Events audience and the same caller bearer.

Reviewed remote tool contracts retain immutable snapshot data, exact call identity, canonical arguments, and matching result metadata. The internal snapshot store checks the full stored snapshot digest and rejects conflicting reuse of an ID. Its embedded 018 SQL resource is tested directly but is not registered in the normal migration path. The accepted Projects configuration can include exact reviewedRemoteToolSnapshots references. Orchestrator resolves these references against the immutable store and checks the stored digest, project, and exact reference. It refreshes Projects authority after resolution and rejects missing, changed, duplicate, or foreign references. These checks do not verify a current remote connection or per-call grant. They do not authorize credential use or native network requests.

Typed action mutations use strict request contracts, expected state versions, and idempotency keys. Proposing or revising non-empty or fixed work requires the server's accepted Sandbox binding; a missing registered adapter or negotiation returns 503. The registered adapter resolves, but does not provision or release, an existing resource. Projects authority is refreshed after resolution, then the accepted selection and execution fence are rechecked by the owner CAS. The immutable binding is committed with the winning decision, gate, grant, and outbox transaction. The caller cannot submit a resource pin or override the durable binding.

The Gateway publishes task dispatch as POST /api/v1/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/actions/dispatch with operation ID dispatchCoordinatorExecution. It forwards the request to the Orchestrator coordination owner; the Gateway does not derive task state. The owner returns bounded child completion receipts and includes taskCompletion only when it joins the current claim, confirmed WorkPlan, checkpoint, receipt, and output witness. See the HTTP API reference.

Runtime observation v2 ​

The Gateway exposes the Orchestrator's read-only v2 evidence projection at GET /api/v1/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/runtime-observation/v2. The response binds the requested session to its run, root, accepted selection, and current execution fences. It includes the latest retained runtime instance and registration revision for that session and fence when an owner fact records them; both values are null when no matching fact exists. The owner re-reads current authority before returning the response. It does not require an active Host registration or a current checkpoint for a child session, and it does not expose credentials, prompt text, or tool output.

The response includes accepted limits, credit-guard state, run totals, and an ordered history of owner facts. A root read can include child facts; a child read includes facts for that child, while totals remain run-wide. The first page captures a high-water mark. Its opaque cursor continues from that same mark, so facts and the credit-guard summary committed later do not enter the page sequence. Cursors expire after 24 hours and bind to the caller, run, session, accepted selection, and page size.

Use attemptId to look up all recorded facts for one non-empty GUID attempt. An exact lookup cannot be combined with a cursor. If the attempt has more than 100 retained facts, the response returns at most 100 facts, exactUnavailableReason: "attempt_history_exceeds_bounded_aggregate", and a history cursor. Use that cursor without attemptId to browse the retained history. If no exact evidence remains, exactUnavailableReason is "attempt_evidence_not_retained"; an empty result does not prove that the attempt did not occur. complete is true only when the run has a v2 coverage marker. Without one, the response reports legacy_or_uninstrumented_history; it does not reconstruct missing history. Sections use unknown when the owner has no source state and unavailable when the owner cannot establish the requested evidence. Reservations do not prove native sends, consumption, or tool execution. For a tool-call limit denial, a separate toolPermissionRejected fact can show that the runtime recorded a rejection decision after the owner confirmed the exact denial and active MAF dispatch. This does not prove that the SDK received the decision or that the tool did not run. The same fact keeps nativeNoSend and toolExecution unavailable. Numeric denial facts retain their recorded work-plan and checkpoint association when the canonical owner receipt contains one.

Native root-turn completion and Host replacement ​

The existing casting-generation response can include RuntimeRootTurnCompletionEvidence after Orchestrator validates and stores a completed native root turn. It binds the request to the current runtime registration, accepted selection, execution fence, source, model and image. It also records the native event interval, prompt and output hashes, usage event IDs, and Events acknowledgments for the user text, assistant text, and SDK cache. The cache baseline must be complete and contain no extra event. Read user or assistant text through the existing authorized historical-turn route; there is no public SDK-cache read route.

Native child-turn completion ​

The child A2A response can include a RuntimeChildTurnCompletionReceipt after the Host records native completion, persists usage accounting, and receives Events acknowledgments for child user and assistant material. The receipt binds request, prompt, and output hashes to the WorkPlan association, logical child session, native SDK session ID, runtime registration, accepted selection, execution fence, source, image, model selection, actual model, native completion event IDs, usage event IDs, and material acknowledgment references. For an open WorkPlan item, the receipt also carries a hash of the full item bound to the native dispatch. The owner compares this hash with the current confirmed item before deriving task completion. The logical child session comes from the runtime registration. The SDK session ID comes from the native request context. The receipt does not contain prompt or output text.

Orchestrator validates the receipt against the exact dispatch request and current registration, then joins it to the persisted source, native observation, and accounting status. The native event IDs, usage IDs, model, source hash, and owner revisions must match. Task completion requires priced accounting; an unpriced entry can remain visible in the usage ledger but cannot prove task success. Orchestrator stores the verified receipt with the completed checkpoint result. Dispatch returns bounded completionEvidence entries from that checkpoint; a missing or stale receipt does not count as successful task completion.

The Gateway exposes ordinary Host replacement through POST /api/v1/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/runtime-replacements and status through the matching GET route. The strict RuntimeReplacementRequest contains contractVersion, operationId, expectedRuntimeInstanceId, expectedRegistrationRevision, expectedExecutionFence, and expectedAcceptedSelectionHash. Reuse the same operation ID and request body after an uncertain result. The owner persists the operation before effects, retires the old Host, and provisions a new Pod, lease, runtime, and registration through the existing Environment and Broker paths. It retains the workspace and does not change the accepted selection or execution fence.

RuntimeReplacementSummary records operation state, prior and current runtime registrations and Pods, retained workspace generations, recovery mode, cache acknowledgment, and reconstruction evidence. pending or cleanup_pending does not prove success; query the same operation. Unknown provider outcomes do not permit a second replacement.

An exact casting retry after a ready replacement can include RuntimeRootTurnReplayEvidence. It binds the original completion to the verified replacement lineage and current registration. The replay interval and native-call sequence must show no new model request or tool effect. Orchestrator returns the original completion; it does not send the native request again. This receipt path does not relax the general material reader or change the hosted hard-credit guard.

Method and pathContract
POST /api/projects/{projectId}/runsCreate a new chat run. The bearer must not carry a run binding. Requires one Idempotency-Key, current project acceptRunSelection authority, and a body with firstMessage and expectedProjectConfigRevision. Persists the request in project_run_requests, mints runId and rootSessionId, and accepts the selection through the Projects interactive-selection route. Returns 201 with awaiting_binding and the binding selectors. A replay with the same key and body returns the same run; a changed body returns 409 idempotency_conflict.
POST /api/projects/{projectId}/runs/{runId}/startRun-bound and bodyless. Locks the saved request, accepts the root session, and delivers the saved first message as a root-to-root addressed message with key {runId}:first. The owner accepts this self-addressed message only when its payload matches the saved request. Returns 200 with started and the current runtimeStartup summary when startup is enabled; a replay does not deliver again but can queue pending startup recovery.
POST /api/projects/{projectId}/runs/{runId}/cancelRequires a token not bound to a run and fresh Projects cancelRun permission from a Contributor, Owner, or tenant admin; Viewer receives 403. Requires one Idempotency-Key and accepts an optional reason. For an accepted run, advances the fence, sets cancelled_at and completed_at, and cancels active sessions. Pending requests are cancelled without root admission. Saves a caller-scoped receipt and orchestrator.run.cancelled event atomically. A finished run returns 200 with alreadyTerminal: true without mutation or another event.
GET /api/projects/{projectId}/runsList accepted runs in the project, newest first, as a ProjectRunPage. The caller needs api.read, both Orchestrator and Projects audiences, and current project or tenant read permission from Projects & Config. A run-bound token sees only its own run. startedBy=me filters by the caller's exact issuer and subject; its cursor is bound to that identity and filter. The keyset cursor is opaque and bound to the query. A state filter is applied to each run's derived state, so a selective filter can read many older runs before it fills a page. Each ProjectRunSummary reports the run and root-session IDs, saved title, goal and workflow ID when available, derived state, the durable pending decision-gate count, timestamps, completedAt, and the accepting actor as startedBy.
GET /api/projects/{projectId}/source-control/issuesList synced repository issues from the project backlog as a ProjectIssuePage, with no provider call. The caller needs api.read and current project or tenant readProjects; run-bound tokens are rejected. state is open (default), closed, or all. Each ProjectIssueSummary reports the task ID and backlog state, provider, repository, issue number, stored title and state, and task timestamps. It has no issue URL or author because the backlog doesn't store them.
GET /api/projects/{projectId}/source-control/pull-requestsList pull requests that project runs created or reused, as a ProjectPullRequestPage, with no provider call. Authority matches the run list; a run-bound token sees only its run's records. state is open (default), closed, merged, or all. Each ProjectPullRequestSummary reports the provider, repository, number, recorded title and state, URL, head and base branch and commit, runId, disposition (created or reused), recordedAt, and updatedAt. coverage.recordedSince is when migration 032 was applied, and coverage.includesEarlierPullRequests is always false. Before migration 032 is applied, the route returns 503 pull_request_records_unavailable.
/api/chief-of-staff/conversations and /api/chief-of-staff/prioritiesCaller-private Chief of Staff records in Orchestrator migration 024. Requires api.read, both audiences, and a token that is not bound to a project or run. Each call reads fresh Projects authority, filters rows by tenant, issuer, and subject, and redacts conversations and links in projects the caller can no longer read to access: unavailable. A conversation binds a project_run_requests row that the caller created; it holds no message content. Priorities use per-item revision and list orderRevision checks, and create requires one Idempotency-Key. Links store owner identity only. Reads resolve run and conversation links to the derived run state and report issue, pull request, and artifact state as unavailable. No route writes accepted_runs, project_run_requests, sessions, or gates.
POST /api/projects/{projectId}/runs/{runId}/coordination/rootAccept the root session for the current accepted run selection and register it with Events & Sessions. After the accepted root and initial decision state are durable, queue the same first-start continuation and return its current runtimeStartup summary when startup is enabled.
GET /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/decisionsRead the current typed decision state and pending gate without exposing a transferable authorization or provider pin.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/actions/propose_outcome_specPropose a schema-validated outcome specification.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/actions/select_workflowSelect a workflow from the authorized catalog or submit a generated definition for confirmation.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/actions/propose_work_planValidate a plan against the selected workflow, current role/model eligibility, and the accepted Sandbox binding before opening its confirmation gate.
POST /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/pinLegacy secret mode accepts the existing bodyless request and redeems its API SecretRef. GitHub App mode accepts only {"selectionCode":"<64 lowercase hex>"}; it consumes the code for the initial run-bound pin and persists only its hash, never the code in project/run configuration or the pin response. First pin returns 202 with SourceControlRepositoryPinView; an exact existing pin returns 200. Both paths recheck fresh Projects/Core authority.
POST /internal/projects/{projectId}/source-control/team-sync/treeInternal project-scoped Source Control operation. Requires current project read authority and a valid repository-selection code, then reads regular .squad/ blobs at the requested ref with a contents-only token. Before returning the snapshot, it rechecks current authority and repository configuration. It rejects traversal, symlinks, submodules, incomplete trees, and oversized files or trees.
POST /internal/projects/{projectId}/source-control/team-sync/commitInternal project-scoped Source Control operation. Requires current project write authority and a valid repository-selection code. It checks the previewed branch SHA, each expected blob SHA, and the complete resulting tree limits before creating Git objects. It accepts changes only beneath .squad/, rechecks current authority and repository configuration immediately before the non-forced branch update, and rejects stale or conflicting inputs without advancing the branch. These internal routes are owner contracts, not the versioned Gateway API.
POST /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/workspaces/{workspaceId}/output-capturesCapture the existing bound workspace using its base-SHA/branch binding while the run is active, idle, or blocked. Source Control persists the sealed package with its pending proof. A retry for that workspace reuses the exact package without reading the live checkout; changed capture inputs conflict until the pending entry is resolved. A new capture returns 201; an exact idempotent replay returns 200. Admission follows the exact Events & Sessions journal acknowledgment and fresh authority/run-state checks.
GET /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/output-capturesList admitted captures after current read-authority and accepted-selection checks. limit defaults to 50 and is bounded to 100. Continue with both beforeCapturedAt and beforeCaptureId from the preceding page; the pair must be supplied together.
GET /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/output-captures/{captureId}Return the admitted capture summary and canonical manifest. Pending or unadmitted records are not exposed.
GET /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/output-captures/{captureId}/diffReturn the verified captured patch for this admitted capture.
GET /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/output-captures/{captureId}/files?path={relativePath}Return one manifest-listed file as application/octet-stream and its SHA-256 in X-Source-Control-Output-Sha256. The path is a safe relative workspace path, not a host path. The Gateway serves the same five output-capture routes under /api/v1/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId} with a required X-Agentweaver-Tenant header, and the MCP host exposes them as agentweaver_ tools.
POST /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/merge-intentsRead current PR facts from the pinned provider, persist an immutable merge request, then open typed Approval for that exact intent and accepted Merge step.
GET /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/merge-intents/{intentId}Read an owner-bound merge intent without exposing credential values or transferable authority.
POST /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/merge-intents/{intentId}/executeExecute only through the current source-specific grant and existing action guard, under a repository-scoped lock and exact-head/check preflight. The expected base is a fresh preflight, not an atomic compare-and-swap.
POST /api/projects/{projectId}/runs/{runId}/source-control/sessions/{sessionId}/webhook-relayAccept raw GitHub bytes only from an authenticated run-bound relay; verify the pinned webhook SecretRef, repository identity, current authority, and durable delivery id.
POST /api/source-control/github/webhookReject direct GitHub delivery. No trusted unauthenticated-to-run relay identity is deployed in this source slice.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/actions/revise_work_planValidate a bounded revision against the same immutable run context; scope changes require a gate.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/actions/request_assemblyRecord a typed assembly request against an accepted workflow, plan, and platform step. It does not execute assembly.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/decisions/gates/{requestId}/answerAnswer an exact pending gate with one of its allowed choices. Message receipt is not an answer.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{parentSessionId}/childrenRegister a child under the active parent and register the child session with Events & Sessions.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{parentSessionId}/spawnSpawn and register a child. When mapped to a WorkPlan item, the Orchestrator checks the latest confirmed root decision under the owner lock and rechecks current Projects authority before committing the child and spawn outbox.
GET /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/treeRead the current owner session-tree snapshot after checking Projects authority and accepted selection; returns Cache-Control: no-store.
GET /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/statusRead the owner's session status, blockers, lifecycle, and runtime-effect availability; unavailable activity/effects are reported explicitly. When enabled, runtimeStartup reports pending, ready, blocked, cleanup_pending, or cleanup_complete, plus the current step and optional failure code. The accepted selection is rechecked before response.
GET /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/execution-planRead the current confirmed WorkPlan, latest checkpoint progress, direct child startup bindings, and selected recovery state in one repeatable-read owner transaction. Requires the current coordinator root and accepted Projects selection. Rechecks the owner root and execution fence in that transaction, then rechecks Projects authority before response. Returns Cache-Control: no-store and hashes and identifiers, not child result text, credentials, or bootstrap material. A missing plan returns 404. Invalid or over-limit plan, checkpoint, child, or recovery data returns 409 execution_plan_unavailable; stale selection keeps its existing 409 response. The endpoint never truncates the response and returns 409 execution_plan_unavailable when it exceeds 8 MiB.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/forkAccept a typed request containing executionFence, idempotencyKey, targetSessionId, sourceEventId, sourceCursor, and non-coordinator kind. The Orchestrator durably reserves the exact request and accepted-selection hash, then rechecks current Projects authority after its owner SQL waits before committing that reservation. Events must obtain an owner admission receipt for the current actor, selection, and fence before journal work and immediately before commit. The Orchestrator registers returned lineage only after its final owner recheck after child, request, command, and outbox writes; if authority is revoked after Events commits, owner registration writes roll back and the result is explicitly unregistered. Returns 201 for a new registration, 200 only for an authorized exact registered replay, 403 for current permission revocation, or 409 for stale/conflicting admission or owner state. An unregistered target is not a usable child.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/messagesPersist a fenced owner message and synchronously admit it to Events against the exact persisted outbox record.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/turn-boundaryAdvance the logical turn, claim and present the next eligible addressed message, and return pending parent notifications. A retry with the original state version returns the completed boundary result. A blocked session can resume only when a wake is pending.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/turn-completionRecord an explicit idle, blocked, or completed turn state under the current fence and state version.
GET /api/projects/{projectId}/runs/{runId}/coordination/statusRead the accepted run's owner state, current execution fence and state version, and any active failure cause/reference.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/turn-failureReport a logical failed or indeterminate turn with idempotency key, cause/reference, current run version, session version, and fence. The owner advances the run fence, marks other active turns indeterminate, persists the operation and outbox event atomically, and does not claim physical effects.
POST /api/projects/{projectId}/runs/{runId}/coordination/recoveryRecover a failed/indeterminate run using its current fence/state version plus an idempotency key and recovery cause/reference. The owner advances the fence again, resets only failed/indeterminate logical turns to idle, and commits a recovery outbox event; it does not replay or compensate physical effects.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/suspendAccept { "idempotencyKey": "..." }. Until a real authenticated AgentHost drain/checkpoint path can produce the required cache, journal, workspace, and network evidence, persist an interrupted operation/manifest and return 503; do not claim suspension or a new Core fence. An exact retry replays the recorded outcome. If the 019 schema extension is not active, return an explicit schema-unavailable 503 without claiming a persisted operation.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/resumeAccept { "idempotencyKey": "...", "manifestId": "..." }. Validate the manifest's run/session scope, canonical hash, and fence, then fail closed with a persisted interrupted operation/manifest and 503 until a real restore, current egress verification, and fenced dispatch path exists. If the 019 schema extension is not active, return an explicit schema-unavailable 503 without claiming a persisted operation.
POST /internal/runtime/suspend/require-currentAuthenticated host control path. Accept the exact RuntimeHostSuspendRequest and return that same request only when its proof's current registration binding and Projects authority match the persisted suspend operation, reserved manifest ID, fence, fenced phase, and positive phase version. The check does not require or create a terminal manifest before capture. Workspace data generation can be zero, but a completed suspended manifest still requires an exact tree hash or provider checkpoint.
GET /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/notifications?limit={limit}Read unacknowledged parent notifications; the limit defaults to 50 and is bounded to 100.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/notifications/{notificationId}/acknowledgeAcknowledge a notification belonging to this parent session.
POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/messages/{messageId}/acknowledgeAcknowledge a delivered message using its claim fence; receipt is not gate approval or work completion.

Output capture is a bounded sealed-tree snapshot, not an atomic filesystem snapshot. Its canonical manifest binds safe relative paths, Git modes, per-file SHA-256 digests, and lengths; the package and diff have independent digests. Limits are 10,000 files, 16 MiB per file, 64 MiB total file content, 32 MiB for the manifest, and 8 MiB for the diff. Source Control records the proof as pending before Events & Sessions stores the package bytes in Object Store and appends the typed journal event. Only the exact journal event ID and position acknowledged by Events can admit the immutable owner record. The event ID is derived by the owner; callers cannot provide provenance. Reads recheck current Projects authority and accepted selection, verify the journal-backed package and file digests, and do not fall back to the live workspace. Completed-run history remains available; failed or indeterminate runs and pending captures return not found. These owner-backed history routes can support a retained UI without making a UI part of this contract. | POST /internal/projects/{projectId}/runs/{runId}/coordination/message-route | Events-only owner callback. Confirms the full outbound message matches the durable owner outbox, then validates active session relationship, writer, request/reply correlation, and current execution fences. | | GET /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/owner-binding | Events-only current session binding for message claim, presentation, and acknowledgment. Returns Cache-Control: no-store. | | GET /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/runtime-owner-context | Read-only mapped agent/model/turn context using the shared RuntimeOwnerContext contract in Agentweaver.Abstractions. Returns no-store metadata only if the child owner row and latest root decision still match, dispatch remains enabled for the confirmed item with no pending gate, and Projects authority/selection remain current; otherwise returns 409. | | GET /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/runtime-execution-observation | Read-only current child checkpoint observation using the RuntimeExecutionObservation contract. It returns only that child’s status, pending message/prompt hashes, and completed-result digest/UTF-8 length—never result text. It rechecks the active owner, decision, mapping, and Projects selection after the checkpoint read; stale state returns 409. | | GET /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/runtime-execution-observation/v2 | Uses the same read-only authorization and stale-state checks. Its version-2 wrapper contains the unchanged validated v1 observation and a checkpointParent object with required hasParentMetadata and nullable parentCheckpointId fields. True/null means a verified root; false/null means unknown legacy metadata. Contradictory or invalid saved parent data returns 409; the v1 route and response remain unchanged. | | GET /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/build-test/commands/{checkpointId}/{stepId} | Reads the immutable accepted BuildTest command metadata. Requires workPlanId, checkpointRevision, decisionStateVersion, executionFence, and acceptedSelectionHash query values plus current owner and Projects authorization. Version 2 includes the bound workspace-source metadata, never binary seed bytes. Rechecks current selection, decision, fence, and command after store reads. Returns no-store; stale references return 409. | | GET /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/build-test/commands/{checkpointId}/{stepId}/workspace-seed | Uses the same complete reference and authorization to read the original version-2 seed through the existing checkpoint store. Rechecks current authority and command after hydration. Returns bounded raw application/octet-stream bytes with no-store, not JSON or a caller-selected URL. Version 1 returns 404; stale references return 409. Environment verifies the exact accepted length and SHA-256 digest before execution. | | POST /api/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/build-test/commands/{checkpointId}/{stepId}/workspace-capture/verify | Checks the exact native capture reference, collector Pod, and journal acknowledgment against the current accepted command, original seed, and canonical admitted Source Control row. Requires a matching object reference and positive journal position. Rechecks current command and source-owner authority after reads. Returns the verified ProducedRunCaptureJournalEntry with no-store. A caller-supplied acknowledgment alone is not admission. | | POST /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/fork-admission | Events-only owner callback. Requires the forwarded authenticated actor and exact target/event/cursor/idempotency request to match a durable pending fork reservation, and revalidates the current accepted selection and execution fence. Returns a typed SessionForkAdmissionReceipt with Cache-Control: no-store; an absent, changed, stale, or terminal reservation returns 409. | | GET /api/projects/{projectId}/runs/{runId}/coordination/policy-evaluations/{receiptId} | Events-only read of the immutable Orchestrator-owned PolicyEvaluation receipt. | | GET /api/projects/{projectId}/runs/{runId}/coordination/policy-evaluations/{receiptId}/admission | Events-only current admission check for that exact owner receipt. Every outcome requires current Core write authority and accepted selection, plus the matching actor/tenant and active owner session/run writer/fence. The owner rechecks authority after SQL row-lock waits, including duplicate receipt paths. Allow also requires the exact unexpired grant/fence; Deny/Error can reference an issued inactive grant but remain non-authorizing immutable facts. Returns no-store. |

For complete runtime-setting guidance, see Runtime configuration.

Configuration:

KeyRequirement
ConnectionStrings:OrchestratorPassword-free PostgreSQL connection with an Entra runtime role.
Orchestrator:Database:WorkloadIdentity:{TenantId,ClientId,TokenFilePath}Required runtime workload identity.
ConnectionStrings:OrchestratorMigrationSeparate connection with the migration Entra role; used only by --migrate.
Orchestrator:Migration:WorkloadIdentity:{TenantId,ClientId,TokenFilePath}Required migration workload identity.
Orchestrator:SchemaOptional service-owned schema name; defaults to orchestrator.
Identity:Issuer / Identity:AudienceHTTPS issuer and incoming Orchestrator audience.
ProjectsConfig:ProviderCatalogOptional catalog-owner snapshot used to validate the accepted Sandbox candidate. With no snapshot or no registered Sandbox resource adapter, plans needing isolation fail closed with 503.
ProjectsConfig:AuthorizationContext:OwnerBaseAddress / AudienceTrusted HTTPS Projects & Config owner and required audience for current authority and selection.
EventsAndSessions:Authorization:OwnerBaseAddress / AudienceTrusted HTTPS Events & Sessions owner and required audience for session registration and message delivery.
Orchestrator:RuntimeRegistration:EnvironmentOwnerAddressOptional fixed HTTPS root for current Environment lease/profile lookup. Without this key, runtime registration routes are not mapped.
Orchestrator:RuntimeUsage:BrokerOwnerAddressOptional fixed HTTPS Broker root for current observe-grant validation. Requires runtime registration configuration.

For complete runtime-setting guidance, see Runtime configuration.

Runtime PostgreSQL access uses the PostgreSQL Entra token scope and TLS VerifyFull; the connection string must include the Entra role and omit a password. Ordinary startup verifies the service schema. Run the executable with only --migrate to apply migrations using the separate identity. Coordination schema version 11 also applies immutable runtime registration, SDK source, and observation receipt tables after the admitted session-tree and recovery migrations. The runtime role does not apply this migration during ordinary startup.

Events & Sessions journal ​

The Agentweaver.EventsAndSessions service is an unpublished .NET 10 host candidate. Its protected session routes require an OpenIddict-validated bearer token with a GUID sub and exactly one project_id and run_id pair issued for an active core grant. The accepted-effect project-fact route separately checks the receipt's original issuer, subject, project/run bounds, and fresh effective project permission. These are service-internal contracts, not public product API routes; tenant and platform role claims are not required.

Most Events & Sessions routes are service-internal contracts. The Gateway also exposes the project-scoped Azure Retail price search described in the API reference; Events checks the caller's current Projects role before it calls Azure Retail.

The Events & Sessions migration Job runs the executable with only --migrate. The host validates Sessions and Messaging options before entering that branch, so the Job repeats each option from the runtime map instead of relying on defaults. Orchestrator selects its migration branch before loading normal provider settings.

Method and pathContract
GET /health/liveProcess liveness.
GET /health/readyPostgreSQL and current owned-schema readiness; returns 503 when the schema is absent or outdated.
POST /internal/sessions/{sessionId}Resolve and pin the run's native Sessions provider, then create the session. A run reuses its immutable provider binding; a different binding returns 409.
GET /internal/projects/{projectId}/runs/{runId}/sessions-provider-bindingReturns the actual immutable SessionProviderBinding, not an accepted candidate. Requires existing current ReadRunSelection and exact signed project/run binding before and after verified retrieval. No option values or credentials. Returns no-store.
GET /api/projects/{projectId}/model-pricing/azure-retail?region={region}&search={text}Events asks Projects to authorize the same caller and project before searching USD Foundry Models consumption meters through the fixed Azure Retail endpoint. Requires api.read and current PlatformAdmin or exact project Owner authority. The bounded result uses Cache-Control: no-store and does not change rate cards.
POST /internal/sessions/{sessionId}/eventsAppend an ordinary versioned typed event to the project/run journal. Returns 403 for every generic PolicyEvaluation payload because actor equality does not establish trusted Core provenance. Ordinary appends return 201 for a new event, 200 for an identical run-scoped event-ID retry, and 409 if the ID is reused with different event content in that run.
POST /internal/sessions/{sessionId}/forkAccept SessionForkRequest (targetSessionId, sourceEventId, sourceCursor, idempotencyKey). Requires a matching Orchestrator owner admission before journal work and immediately before transaction commit, including identical journal retries; validate that the cursor and event identify the same committed source event, then persist the target and immutable lineage. Existing object-reference retention deadlines are unchanged. Returns 201 for a new fork, 200 for an identical retry, 409 for missing/stale admission or conflicting event/cursor/target/key use, or 503 when the pinned Sessions provider does not support explicit forks.
POST /internal/sessions/{sessionId}/policy-evaluationsAppend a PolicyEvaluation using a body containing only receiptId. Requires the pinned provider's sessions.policy.evaluations capability. Events fetches the immutable receipt from the fixed Orchestrator owner, validates current admission before writing, and repeats that check inside the native journal transaction before commit. Failed revalidation rolls back event, inbox, position, references, and outbox writes. Returns a no-store acknowledgment with receipt ID, session identity, event position, and duplicate status (201 new, 200 identical retry).
POST /internal/sessions/{sessionId}/usage-receiptsOptional native usage route. Accepts only receiptId, fetches immutable Orchestrator evidence, and commits source hash, price, rate card, ledger, and inbox atomically. Returns a no-store accounting acknowledgment.
POST /internal/sessions/{sessionId}/materialOptional typed SessionMaterialWriteRequest route. Accepts actual TurnContent or SdkCache bytes, at most 1 MiB, with event ID, runtime ID, registration revision, and execution fence. Requires the original bearer, current Projects authority, recorded SDK source, and exact current runtime binding. Stores bytes before the journal reference. Rechecks authority after waits and on retries. Returns the original no-store acknowledgment for identical material, 409 for changed event reuse, or an explicit authority/storage error.
GET /internal/sessions/{sessionId}/material/{eventId}/{kind}Reads only committed material by session, event, and kind. TurnContent requires current ReadRunSelection or actually supplied ReadProjects entitlement, exact signed project/run binding, and recorded session membership. Project-summary access alone does not authorize opaque bytes. SdkCache retains Core ReadRunSelection authority. The route verifies the recorded Sessions provider, digest, length, kind, and version, then rechecks read authority after retrieval. Historical content does not require dispatchability, a live lease, or model credentials. Returns a no-store SessionMaterialReadResult. Arbitrary object keys, paths, and URLs are not accepted.
GET /internal/projects/{projectId}/runs/{runId}/usageOptional native usage totals route. Requires current ReadRunSelection for the exact signed project/run and returns exact run and agent totals.
POST /internal/projects/{projectId}/runs/{runId}/usage/copilot-run-admissionOptional run-start pricing route. Accepts contract version 1 and only the accepted-selection hash. Requires current ReadRunSelection and AcceptRunSelection, rereads the trusted Projects selection, and resolves the shared versioned AgentHost model map. Returns a no-store receipt with the concrete model/connection, the Cost pin when available, an explicit quote, and Copilot-only totals. Missing rates remain Unpriced and do not block root acceptance or dispatch; only the known priced subtotal counts toward credit limits. Malformed or tampered receipts fail closed, and no SDK or usage evidence is invented.
POST /internal/projects/{projectId}/runs/{runId}/usage/copilot-cost-snapshotOptional observed pricing route. Requires current run authority and exact immutable source and ledger references. Native references require matching authenticated Core proof reads before and after the Cost transaction. Returns no-store; unavailable or changed evidence fails.
GET /internal/sessions/{sessionId}/events?cursor={cursor}&limit={limit}Read an ordered page for one session after an optional opaque cursor. Positions are run-wide and can have gaps in a session-only page.
GET /internal/sessions/{sessionId}/events/live?cursor={cursor}&maximumEvents={count}&maximumDurationSeconds={seconds}Poll durable journal state and stream NDJSON SessionEventDelivery records, each containing the event and a reconnectable nextCursor.
GET /internal/projects/{projectId}/runs/{runId}/events?cursor={cursor}&limit={limit}Read a bounded, run-ordered page across all sessions in the authorized project/run.
GET /internal/projects/{projectId}/runs/{runId}/events/live?cursor={cursor}&maximumEvents={count}&maximumDurationSeconds={seconds}Poll and stream run-ordered NDJSON deliveries across sessions; each delivery includes a reconnectable nextCursor.
POST /internal/project-facts/accepted-effectsAppend a project-scoped accepted-effect fact. The body contains receiptId, schemaVersion, and eventVersion, plus either both projectId and runId (current scoped request) or neither (the original three-field N-1 request); a partial scope returns 400. Scoped requests read only from the already-pinned Memory provider. The legacy unscoped request reads from the native PostgreSQL Knowledge route. Events fetches the receipt from the fixed Knowledge owner, requires the original issuer/subject/resource bounds and current WriteProjects, then commits the fact, project sequence, and inbox receipt atomically. Neither route falls back to the other. Returns the persisted acknowledgment for new and identical requests; changed reuse returns 409.

Project accepted-effect facts have their own address and sequence. They do not enter session_events, use or change a run's Sessions-provider pin, or represent a session/run transition. The durable acknowledgment binds the receipt and contract versions to the native fact ID, project, and sequence.

The Agentweaver.Abstractions contract provides ISessionsJournal, SessionSubscriptionRequest, SessionIdentity, AppendSessionEvent, and a discriminated SessionEventPayload; Agentweaver.EventsAndSessions supplies the PostgreSQL implementation. Event version 1 supports turns, tool calls, accepted decisions and effects, artifact references, and cache references. Event version 2 adds a typed PolicyEvaluation payload; existing version-1 payloads remain appendable and replayable. The generic run-scoped append route rejects every PolicyEvaluation payload because actor equality does not establish trusted Orchestrator Core writer provenance. The dedicated receipt-reference route fetches immutable Orchestrator evidence and requires current owner admission before and during its native transaction. Every outcome requires fresh current Core authority, accepted selection, matching actor/tenant, and the current owner session/run writer and fence. The owner rechecks Core authority and accepted selection after SQL row-lock waits and before returning admission success. Allow receipts additionally require an exact, active grant/fence match; Deny/Error receipts can reference an issued inactive grant but remain same-actor immutable evidence, not an allowance. The envelope binds project/run/session. The payload contains bounded actor/tenant/step, grant reference/revision, purpose/action/fence, outcome/reason, and provider/options identity metadata. It has no arbitrary message or credential fields. Other large payload content is represented by opaque ObjectKey references; the journal does not store referenced bytes.

The run-level provider pin records provider ID, adapter version, options schema version and revision, negotiated resource ID and generation, and capabilities. It is inserted with the first session for a project/run and cannot be replaced by another create request. Append, replay, and subscription verify the stored pin against the exact registered provider and resource before proceeding; there is no provider fallback. Run cursors are opaque and bound to the project/run; session cursors are additionally bound to the session. Callers should return either token unchanged on replay or reconnect.

Private reviewed tool result material ​

RemoteToolResultProof binds the full reviewed call, snapshot, actor and tenant, accepted revisions, registration and fence, and native action admission. RemoteToolResultVerificationReceipt contains the derived result event and exact proof digest. These values are not caller-granted authority.

Method and pathContract
POST /internal/runtime/remote-tool-results/verifyOrchestrator checks the configured native mutual-TLS peer before reading the proof. It reconstructs the current selected call and verifies native action admission and the reserved tool slot.
POST /internal/sessions/{sessionId}/remote-tool-resultsEvents accepts typed RemoteToolResult material only from its configured Orchestrator TLS peer, with the original current actor. It stores bytes before the journal reference and returns a fully bound SessionMaterialAcknowledgment.
POST /internal/sessions/{sessionId}/remote-tool-results/readEvents accepts a call proof, verifies the committed result and current authority, and returns bounded bytes with their acknowledgment. Missing recorded material returns 404; changed material or authority is not treated as missing.

All handled responses use no-store. Generic material routes and public event routes do not grant private result access. The shared receipt validator requires exact event, identity, runtime binding, proof, source, length, and SHA-256. A read template can adopt only the recorded content class; all other proof fields remain exact. See the TLS configuration and unproven acceptance boundary.

The service also exposes protected internal addressed-message routes:

Method and pathContract
POST /internal/addressed-messages/admitAccept an Orchestrator outbox message only after the Orchestrator validates the exact persisted message, current participants, request/reply correlation, and execution fences. Returns an admission receipt.
POST /internal/addressed-messages/projects/{projectId}/runs/{runId}/sessions/{sessionId}/claimClaim the next eligible message only while the current Orchestrator session binding is presenting.
POST /internal/addressed-messages/projects/{projectId}/runs/{runId}/sessions/{sessionId}/messages/{messageId}/presentMark the fenced claim as presented only while the current Orchestrator session binding is presenting.
POST /internal/addressed-messages/projects/{projectId}/runs/{runId}/sessions/{sessionId}/messages/{messageId}/acknowledgeRecord receipt under the current session and claim fences. A valid correlated reply makes its request input_available on admission; this acknowledgment does not approve a gate or complete work.

The store writes messages with idempotency scoped to the sender run and session, a per-thread sequence, journal reference, and outbox record transactionally. Progress messages remain in sender history and are not presented as recipient input. Reply threads can be derived from the correlated reverse message. The store supports fenced delivery-state operations. Owner relationship and accepted-selection checks are performed by the Orchestrator through current Projects & Config authority. Orchestrator admission is synchronous; these source additions do not include a background delivery relay, a gate-approval decision, or automatic AgentHost scheduling. See the owner integration and persistence boundary.

Configuration:

KeyRequirement
ConnectionStrings:EventsAndSessionsPostgreSQL connection for the service-owned schema and transactional outbox/inbox.
Identity:IssuerAbsolute HTTPS OpenIddict issuer used to validate caller tokens.
Identity:AudienceRequired token audience for the service.
EventsAndSessions:Knowledge:BaseAddressFixed absolute HTTPS Knowledge owner URI for committed accepted-effect receipts; redirects are rejected.
ProjectsConfig:BaseAddressFixed absolute HTTPS Projects & Config owner URI for fresh project authorization; redirects are rejected.
EventsAndSessions:Provider:ResourceIdStable opaque resource identity used in the Sessions provider pin.
EventsAndSessions:Provider:DatabaseNameExpected live PostgreSQL database name; negotiation compares it with current_database().
EventsAndSessions:Provider:ResourceGenerationPositive generation recorded in the immutable provider pin.
EventsAndSessions:Provider:SchemaOptional owned schema name; defaults to events_sessions.
EventsAndSessions:Provider:OptionsRevisionOptional provider options revision; defaults to native-postgres-v1.
EventsAndSessions:Provider:OptionsSchemaVersionOptional options schema version; defaults to 1.
EventsAndSessions:Provider:PollIntervalMillisecondsOptional live-poll interval from 50 to 30,000 ms.
EventsAndSessions:Provider:ReferenceRetentionDaysOptional object-reference retention from 1 to 3,650 days.
EventsAndSessions:ProjectOverrides:{projectId}Optional project-level provider IDs permitted by the host catalog.
EventsAndSessions:Messaging:OptionsRevisionOptional native Messaging provider options revision; defaults to native-postgres-messaging-v1.
EventsAndSessions:Messaging:OptionsSchemaVersionOptional Messaging options schema version; the current provider accepts only 1.
EventsAndSessions:Messaging:ClaimLeaseSecondsOptional claim lease from 10 to 3,600 seconds; defaults to 120.
EventsAndSessions:Messaging:MaximumMessageLifetimeDaysOptional message lifetime from 1 to 7 days; defaults to 1.
ProjectsConfig:AuthorizationContext:OwnerBaseAddressTrusted HTTPS Projects owner base address for current authorization context and accepted run selection.
ProjectsConfig:AuthorizationContext:AudienceAudience required on the incoming token when the internal owner client is called.
EventsAndSessions:Database:WorkloadIdentity:{TenantId,ClientId,TokenFilePath}Required explicit workload identity for the runtime PostgreSQL Entra role.
ConnectionStrings:EventsAndSessionsMigrationSeparate PostgreSQL connection using the migration Entra role; required only by --migrate.
EventsAndSessions:Migration:WorkloadIdentity:{TenantId,ClientId,TokenFilePath}Separate explicit workload identity used only by --migrate.
EventsAndSessions:RuntimeUsage:EnabledDefault-off reference-only SDK usage consumer and totals routes.
EventsAndSessions:SessionMaterial:ContainerUriOptional explicit HTTPS Blob container for typed material. Enables the material routes with the Events & Sessions workload identity, which receives Storage Blob Data Contributor on the private session-material container only. User information, query parameters, fragments, and nested container paths are rejected.
EventsAndSessions:OrchestratorOwner:OwnerBaseAddress / AudienceFixed HTTPS Orchestrator owner and existing required audience for immutable source receipts.

Both connection strings must omit passwords and name their Entra database role. Connections use TLS VerifyFull and the PostgreSQL Entra token scope. The runtime identity only verifies applied migrations and uses the already-created schema; it cannot run DDL. Run the executable with only --migrate to apply embedded migrations with the separate privileged identity. Ordinary startup verifies the service and outbox schema and fails if a migration is pending. The service remains source-only: the repository does not include its deployment, a Gateway route, automatic AgentHost scheduling, an active delivery relay, or consistency-manifest workflow. See the Events & Sessions journal reference.

For Knowledge promotion, the caller's existing bearer is forwarded when it is audience-correct for both owners. If separate audience-correct tokens for the same caller are already available, the caller can provide the Events token in X-Agentweaver-Events-Authorization. Knowledge forwards its original bearer to Events in a redacted request-only header. Events uses that bearer to fetch the receipt. Neither token is acquired or persisted. The runtime does not provision these audiences.

Identity broker endpoints ​

These routes belong to the unpublished Identity broker candidate. They are service contracts in source, not deployed product endpoints.

Method and pathContract
GET /Redirect to /.well-known/openid-configuration with HTTP 302.
GET /connect/authorizeOpenIddict authorization request and external sign-in or consent prompt. Supports prompt=none: it never displays sign-in or consent UI, and returns an authorization code only when the same client already has valid consent for the requested scopes. The agentweaver-cli client can add a workspace_selection_request parameter. See Native Workspace repository review.
GET /connect/authorize/resumeSingle-use external sign-in continuation; preserves prompt=none after successful upstream sign-in and returns silent interaction errors to the registered redirect URI.
POST /connect/consentConsent handle, approval, optional scope subset, local cookie, and X-CSRF-TOKEN.
POST /connect/tokenForm-encoded authorization-code or refresh exchange. An authorization-code exchange for an approved native repository review also returns workspace_selection. Unbound interactive Entra tokens carry aw_actor_class = "human" (preserved across refresh_token for that session, never emitted on bound or workspace_selection tokens).
GET /diagnostics/whoamiBearer validation diagnostic. It is not an audience acceptance test.
POST /secrets/redeemValidated bearer and exact secret ID, version, purpose, and run ID.
POST /internal/connections/remote-mcp/registerBind the authenticated human, tenant, project, current Environment connection revision/resource, configured issuer/client/callback, and operator-approved scopes.
GET /internal/connections/remote-mcp/{connectionId}Read owner-authorized, no-store status without exposing token references or values.
POST /internal/connections/remote-mcp/{connectionId}/consentLink the exact Environment revision, validate current provider client, redirect, resource, and scopes plus issuer metadata, persist a short-lived state/PKCE correlation and protected verifier reference, then return an authorization URI. This route does not redirect the browser.
POST /internal/connections/remote-mcp/callbackResolve the pending connection from the hashed callback state for the current owner; accept either the state and authorization code or the state and access_denied, recheck current provider approvals, owner, and Environment binding, claim once, exchange only an authorization code, and persist only protected token SecretRefs.
POST /internal/connections/remote-mcp/{connectionId}/refreshClaim the exact authorized credential revision, redeem its protected refresh-token reference, recheck current authority and Environment binding, and persist rotated token references with compare-and-swap. Stale claims and uncertain provider outcomes become indeterminate and are not retried.
POST /internal/connections/remote-mcp/{connectionId}/disconnectRevision-check and clear local credential references; provider revocation is not yet wired.
POST /internal/connections/remote-mcp/{connectionId}/validityRead-only credential validity for { expectedConfigurationRevision, expectedConfigurationSha256 }. Checks project read authority before and after the Environment read, reads the connection row again, and returns CredentialChanged when any revision or state moved. Denials: NotConnected, ConsentPending, RefreshPending, RefreshIndeterminate, Disconnected, Revoked, Expired, ConfigurationChanged, ConnectionRemoved, CredentialChanged. It never refreshes or recovers a credential.
GET /health/liveProcess liveness.
GET /health/readyPostgreSQL connectivity.
GET /auth/github/repo-app/csrfReturn no-store {"csrf_token":"…"} and set the antiforgery cookie for local-cookie Repo App routes. JSON POSTs send the token in X-CSRF-TOKEN with credentials included; same-origin form POSTs use the default __RequestVerificationToken field.
POST /auth/github/repo-app/connectRequire the local Identity cookie and antiforgery token, create owner-bound PKCE state, set the callback cookie, and redirect to GitHub OAuth.
POST /auth/github/repo-app/installRequire the local Identity cookie and antiforgery token, then start an owner-bound GitHub App installation callback.
GET /auth/github/repo-app/callback?state=…&code=…[&installation_id=…][&setup_action=…]Complete the single-use user OAuth or installation callback using the local owner, state, and callback cookie; clear the cookie and redirect to the settings page on success. Responses are no-store.
GET /auth/github/repo-app/statusReturn no-store status {state,localReadiness,connectionId,connectionRevision,githubLogin,accessTokenExpiresAt,updatedAt}. state: not_connected, connected, revoked, rotation_uncertain; localReadiness: not_connected, access_token_available, refresh_required, refresh_in_progress, reauthorization_required, rotation_uncertain. Status reads persisted state and does not probe GitHub.
POST /auth/github/repo-app/disconnectRequire local-cookie owner and antiforgery; body {"connectionId":"…","expectedConnectionRevision":1}. Returns the status DTO after revoking the local connection and cached installation records; it does not uninstall the GitHub App remotely.
GET /auth/github/repo-app/repositoriesDiscover installations and repositories available to the connected GitHub user; no-store response {connectionId,connectionRevision,githubLogin,repositories:[{installationId,repositoryId,fullName,ownerLogin,isPrivate,defaultBranch}]}.
POST /auth/github/repo-app/selectionRequire local-cookie owner and antiforgery; body {"installationId":123,"repositoryId":456}. Return no-store {code,connectionId,connectionRevision,installationId,repositoryId,repositoryFullName} with a short-lived, one-time code for that exact repository.
POST /internal/source-control/github-app/installations/tokenValidate the run-bound Broker bearer and active grant, recheck current connection, installation, repository, selection and permission binding, and return a no-store ephemeral exact-repository token to Orchestrator. Its permission digest is derived from GitHub's actual response; IssueWriteGranted is true only when the response confirms issues:write. A requested but ungranted issues:write fails closed; a 422 never causes a narrower retry, and remints preserve the accepted scope/digest.
POST /internal/source-control/github-app/project-team-sync/tokenInternal mTLS-only route. Recheck the current Projects proof and exact configured repository, then mint one exact-repository token with only contents:read or contents:write. The token is returned only to Orchestrator with no-store and invalidated after its operation; it is not a public credential route.

connectionRevision, installationId, and repositoryId are positive signed Int64 values; the selection route rejects nonpositive installation and repository IDs. connectionId is a string. The durable Source Control pin exposes pinId, repository, providerId, resourceId, resourceGeneration, providerRepositoryId, defaultBranch, isPrivate, and pinnedAt; it does not expose the selection code or any credential value.

The service has no secret-grant administration HTTP endpoint. The browser consent experience belongs to Web; these routes provide its broker protocol.

For a valid prompt=none request, the Broker forwards prompt=none to the external identity provider when it needs to establish a local session. It maps upstream login_required, consent_required, and interaction_required responses from query or form-post callbacks to those same OpenID Connect error codes. A missing or revoked authorization returns consent_required. These errors go only to the registered redirect URI and include the original state; silent authorization does not create or extend a permanent authorization.

Other upstream sign-in failures also return through the one-use authorization continuation. The Broker sends the client a safe OAuth error and fixed actionable error_description; when present, it includes only the numeric Microsoft Entra error code. Provider descriptions and account details are not returned.

When a run-bound GET /connect/authorize request checks the Projects proof, the Broker keeps HTTP 400 access_denied for a denial. It maps 403 orchestrator_role_required to The Project Orchestrator role is required for this project. Projects returns this code only after it confirms current membership and project visibility. It maps 404 run_selection_not_found to The run has no accepted selection. Callers without project visibility, non-members, and unknown or inactive projects keep The project and run authorization is no longer active. The Broker does not return text from the Projects response.

Native Workspace repository review ​

The native CLI uses this review to get one Repo App repository selection for one Workspace read. The review uses the normal authorization-code flow with PKCE. It adds no route.

The CLI sends workspace_selection_request on GET /connect/authorize. The value is base64url-encoded JSON. The request must use client agentweaver-cli, response_type=code, S256 PKCE, the exact loopback redirect URI, and exactly the scopes openid api.read offline_access projects.admin. It must not use prompt=none or a run binding. actorId must be the signed-in local user. operationId is listWorkspaceRepositoryRefs, readWorkspaceRepositoryTree, or readWorkspaceRepositoryFile.

The Broker reads version first. Then it requires the exact field set for that version:

VersionFieldsRepository values
1version, actorId, tenantId, projectId, connectionId, connectionRevision, installationId, repositoryId, repositoryFullName, operationIdThe client sends the connection revision, installation ID, and repository ID. At approval, the Broker requires a fresh GitHub listing to contain the same values.
2version, actorId, tenantId, projectId, connectionId, repositoryFullName, operationIdThe client does not send these values. At approval, the Broker lists the repositories of the approving user's own Repo App connection from GitHub. connectionId must be the user's current connection. Exactly one listed repository must have a full name equal to repositoryFullName (ordinal, case-sensitive). The Broker uses the current connection revision and the installation ID and repository ID of that match.

A request with a missing field, an extra field, or another version fails with invalid_request. A version 2 request that contains connectionRevision, installationId, or repositoryId fails.

The CLI workspace refs, workspace tree, and workspace file commands send a version 2 request. They read connectionId and repositoryFullName from the project configuration.

The Broker shows a review page to the signed-in user. The page shows the repository, project, tenant, connection ID, and action. For version 1, it also shows the connection revision. The Broker calls GitHub only when the user approves the review.

The Broker checks the stored selection, the current connection revision, and the active installation against the requested or found values at approval, when it issues the authorization code, and at the code exchange. If a value changes during approval, the Broker redirects to the client with an OAuth error. If a value changes after approval, the authorization code request or the code exchange fails with invalid_grant, and the Broker returns no selection. If no repository or more than one repository matches a version 2 request, or if connectionId is not the user's current connection, the Broker redirects to the client with temporarily_unavailable and stores no selection.

The code exchange response contains workspace_selection with exactly these fields: version, actorId, tenantId, projectId, operationId, code, connectionId, connectionRevision, installationId, repositoryId, repositoryFullName, and expiresAt. version is the request version. For version 2, connectionRevision, installationId, and repositoryId are the values that the Broker found. The selection code is short-lived and single use. A refresh response does not contain workspace_selection. A selection does not grant project access. The Orchestrator and the Broker still check the current project owner, connection, and repository when the selection is used.

IdentityBroker:WebOrigin is an optional, origin-only HTTPS value, required when IdentityBroker:GitHubRepoApp is configured. It has no path, credentials, query, or fragment. Identity normalizes it and allows credentialed CORS only for the browser authorize, resume, consent, token, and Repo App fetch routes, with GET/POST and the Content-Type/X-CSRF-TOKEN headers. CORS runs before authentication so valid preflights do not require a session; the endpoints still enforce their existing authentication, owner, and antiforgery checks. Internal redemption, installation-token, runtime, diagnostics, and health routes do not receive this CORS policy.

The Repo App provider callback remains an absolute Broker-origin URI. After a valid callback, Identity redirects to the fixed absolute Web completion path /settings/source-control?repoApp=connected; it does not accept a caller-supplied return URL. Broker cookies remain host-only, Secure, HttpOnly, and SameSite=Lax. The Web and Broker origins must remain within the same schemeful site for these cookies; CORS does not override SameSite.

The Repo App routes are mapped only when the optional IdentityBroker:GitHubRepoApp configuration is present. The local-cookie routes do not constitute a settings UI; the token-mint route is an internal source boundary, not a public GitHub endpoint.

Broker access tokens contain the local broker sub, registered OAuth scopes, and resource audience. They do not forward upstream tenant or role claims and do not assign Projects roles. Projects & Config is the sole live owner of issuer-and-subject project memberships and resource-role assignments. Downstream resource services obtain current effective permissions from the versioned owner contract. They do not maintain duplicate membership or role records or caches. OAuth scopes and signed project/run bindings constrain requests but do not create authority.

Runtime credential source candidate ​

Optional runtime bootstrap configuration enables a separate purpose-bound store. These routes require the existing validated Broker audience and return Cache-Control: no-store. A bearer or a configure body alone cannot prove a runtime nonce. Current owner authority, exact registration, purpose, audience, configuration hash, revision, expiry, and cryptographic verifier must match.

These source contracts can deliver a model credential to the current guest AgentHost; they do not implement credential-less execution. The proposed contract changes bind an explicit mode and supported gateway/runtime profile to existing registration, action, provider and ready-check surfaces. In that proposed mode, raw redemption/exchange routes accept trusted external consumers only; a guest gateway proof cannot redeem an upstream credential. The proposed L7 operation endpoint is not a currently mapped Broker or Gateway/BFF route.

Method and pathContract
POST /internal/runtime/bootstrap/requestCurrent-registration delivery receipt; no credential in the receipt.
POST /internal/runtime/bootstrap/verify-pendingPending nonce verification only; cannot consume or issue a source credential.
POST /internal/runtime/bootstrap/consumeCAS consumption receipt after completed Environment delivery.
POST /internal/runtime/bootstrap/exchangeTransient observe credential; exact replay returns the original receipt without a credential.
POST /internal/runtime/source/verifyFresh current-registration and purpose-bound nonce verification.
POST /internal/runtime/source/rotateNew source revision and transient credential.
POST /internal/runtime/source/revokeImmutable revocation receipt.
POST /internal/runtime/model-session/grantCurrent-registration model grant with source mode, credential kind, exact secret version, and hosted connection revision. Slot-backed BYOK also matches the accepted slot identity and exact reference against enabled ledger history.
POST /internal/runtime/model-session/verifyRevalidates the complete receipt against current Identity and runtime authority.
POST /internal/runtime/model-session/redeemTransient credential plus typed current receipt. BYOK reads the exact pinned version from its recorded vault; an enabled historical version remains usable after slot disable. Hosted responses contain only the user access token, never the refresh envelope or OAuth client secret.

Copilot user connections ​

The Identity-owned source candidate supports these authenticated, no-store routes. Begin, completion, refresh, and revocation require fresh, unbound Core authority for the exact project or platform scope. Status requires the same owner and current Core authority.

Receipts contain connectionId, revision, scope, scopeId, state, and freshUntil. The scope values are project and platform. The state values are pending, connected, refreshing, transientUnavailable, reconnectRequired, revoked, and refreshIndeterminate. Begin returns { connection, authorizationUri }; its callback cookie never appears in JSON. Unknown request members deny.

Method and pathContract
POST /internal/connections/copilot-user/begin{ scope, scopeId }. Returns a pending connection receipt and PKCE authorization URI. Sets the secure browser nonce cookie.
POST /internal/connections/copilot-user/complete{ state, code?, error? } plus the same authenticated subject and browser nonce. Claims single-use state before the GitHub exchange.
GET /internal/connections/copilot-user/{connectionId}Returns connection identity, revision, scope, state, and freshness. Contains no credential values.
POST /internal/connections/copilot-user/refresh{ connectionId, expectedRevision }. Claims the current revision before upstream rotation and conditionally publishes an exact protected-store version.
POST /internal/connections/copilot-user/revoke{ connectionId, expectedRevision }. Retains the connection and immutable audit history while denying future runtime use.

The callback requires __Host-agentweaver-copilot-link. Identity sets Secure, HttpOnly, SameSite=Lax, Path=/, and a five-minute lifetime without a Domain. The frontend callback requires the current bearer and forwards only this nonce through its authenticated BFF completion request. The callback does not exchange codes anonymously, store bearer values in state, or persist credentials in PostgreSQL. Gateway routing and browser surfaces remain separate source slices.

Malformed successful OAuth or user responses return an explicit contract error and leave the connection in refreshIndeterminate. The committed credential version remains unchanged, and the same connection cannot repeat the uncertain exchange.

IdentityBroker:CopilotConnection requires explicit ProjectsOwnerAddress, GitHub ClientId, HTTPS CallbackUri, and exact ClientSecretReference. The callback URI must use the fixed browser return path /auth/github/copilot-app/callback. Its origin is explicit operator configuration, not a default host or evidence of live GitHub registration. The same URI is used for GitHub authorization and code exchange. The separate UI bridge uses a same-origin popup and the opener's existing in-memory authentication context. It validates the popup source, origin, and expected state before authenticated completion through Gateway with the actual nonce cookie. The return page has no anonymous credential or mutation authority and persists no browser tokens. The protected-store workload identity requires the separate writer's SET and exact-version GET permissions. This configuration does not change the read-only Secrets principal or provision cloud permissions.

The routes remain mapped when this optional configuration is absent. They return 503 with copilot_connection_writer_unavailable, not a fabricated connection or a route-not-found response. Fresh owner denials return 403 with the exact copilot_connection_* error. Invalid input returns 400 with copilot_connection_request_invalid. Protected-store or upstream outages return explicit 503 errors.

Known refresh rejection produces ReconnectRequired. A known transient response produces TransientUnavailable and permits explicit retry with its new revision. An uncertain upstream rotation, store write, or publication produces RefreshIndeterminate and prohibits blind replay. Failed publication retains the previously committed exact reference. GitHub installation tokens cannot become Copilot user credentials.

AgentHost runtime routes ​

The unpublished AgentHost executable validates a Broker bearer and the exact HTTPS configure audience. It compares the current immutable registration, purpose-bound grant, image, lease, execution fence, and model proof after owner waits. All runtime responses are no-store.

Method and pathContract
POST /runtime/v1/configureRuntimeBootstrapDeliveryRequest. Delivers the pending configure nonce without activating a model session.
POST /runtime/v1/configure/activateRuntimeHostConfigureRequest: version 1, exact registration, consume/exchange operation IDs, and delivered configuration. Exact replay returns the existing immutable session. Workflow-bound Hosted Copilot supports a hard credit limit through prepared-dispatch and native-begin admission. An unbound positive hard limit still fails with runtime_usage_affinity_unavailable; the prepared session is cleaned up and readiness is withheld.
POST /runtime/v1/refreshRuntimeHostRefreshRequest: exact RuntimeHostSessionProof and operation ID. Current Identity and owner authority control rotation and replay.
GET /runtime/v1/readinessReturns the existing noncredential RuntimeHostReadinessReceipt after it revalidates the caller, current registration, session, Observe grant, and readiness evidence. Ordinary configuration includes source-derived recovery mode and evidence bound to the current Host instance; NativeCache reports the exact source acknowledgment, while JournalRebuild reports the authenticated journal position/hash. It does not start an SDK session or send a turn.
POST /runtime/v1/a2a/message:sendRuntimeA2ASendRequest: one user text message, GUID message ID, native context ID, exact runtime proof, and delivery mode. Optional readOnlyToolsOnly metadata restricts that turn to the SDK view tool. immediate precedes pending enqueue work only at the next native idle boundary. A hard-cap denial returns only after the Host records the complete empty native range as source-owned no-send evidence. A completed native child turn can include RuntimeChildTurnCompletionReceipt in the response.
GET /health/liveProcess liveness. It does not prove permission or readiness.
GET /health/readyFresh registration/source/lease/isolation/workspace/egress evidence plus authenticated configuration and measured startup ceilings. Missing evidence returns 503.

The A2A response contains kind, messageId, contextId, role, and actual assistant text parts. Completion follows committed turn content, Policy evidence, and usage accounting. The routes do not implement a scheduler, background relay, or gate approval from message receipt.

Runtime credential verification ​

Identity captures a verifier while the protected credential is live, before database waits. Expiry during a grant-lock wait yields explicit denial and durable revocation for the exact verified nonce. An already-expired input is rejected before verification; that rejection does not prove durable cleanup. Storage and Broker HTTP tests isolate the credential boundaries. The combined local harness separately connects actual Core, Projects, Environment, Orchestrator, SDK, and Events code. External placement and SDK transport, catalog, and pricing inputs remain controlled. This evidence is not cloud deployment or paid model acceptance.

The runtime registration candidate exposes these authenticated, no-store owner reads. Registration alone does not authorize configure delivery or usage ingestion. Identity verifies the separate purpose-bound nonce for those operations.

Method and pathSource contract
POST /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/runtime-registrationsAccepts only EnvironmentId and ProfileId. Derives model, optional exact model SecretRef, agent, turn, selection, fence, lease, provider, and endpoint pins from current owners.
GET /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/runtime-registrationsRequires the current authenticated child owner. It reads no more than 64 scoped registration IDs in pages of 32, revalidates each against current authority, and returns one current match. It returns 409 for no match, ambiguity, or candidate-limit overflow.
GET /internal/runtime/registrations/{runtimeInstanceId}Revalidates the active session/work item, accepted selection, current lease/profile, and registration revision. A raw storage read is not authorization.
GET /internal/runtime/registrations/{runtimeInstanceId}/skillsRevalidates the current registration and accepted run selection, then returns only the enabled skill revisions assigned to its active agent, with exact instructions, resources, digests, and registration binding.
GET /api/projects/{projectId}/runs/{runId}/environments/{environmentId}/sandbox/v1/placementPublic Environment control read. Requires current WriteProjects; returns the exact active, unexpired, owner-fenced lease projection.
GET /api/projects/{projectId}/runs/{runId}/environments/{environmentId}/sandbox/v1/internal/placementInternal run-bound placement read. Uses existing current ReadRunSelection for the exact signed run. Its additive providerPin records the actual successful consumer's provider, adapter/options revisions, resource generation, and negotiated capabilities, without option values or recovery metadata. Does not grant public write permission.
GET /internal/projects/{projectId}/runs/{runId}/environments/{environmentId}/coordination/sessions/{sessionId}/runtime-bootstrap/profiles/{profileId}Uses the canonical manager's retained lease callback to read current Orchestrator context and match a registered profile to the exact placement. Requires current run-bound ReadRunSelection.
POST /internal/projects/{projectId}/runs/{runId}/environments/{environmentId}/coordination/sessions/{sessionId}/runtime-bootstrap/profiles/{profileId}/resolveAccepts RuntimeBootstrapProfileResolveRequest version 1. Reads the current owner-fenced Sandbox placement and owned Service/Pod endpoint, plus the receiver configure URL and audience from immutable AgentHost configuration. Verifies a no-store JSON /health/live response over HTTPS at the observed Pod IP using receiver DNS for TLS, with a 10-second deadline and 4 KiB body limit; sends no credentials and does not reuse a connection across endpoint checks. Persists an endpoint-bound replacement profile and returns RuntimeBootstrapProfileResolveReceipt with its profile ID. The replacement ID pins the requested source profile, authenticated actor, and accepted selection hash; the stored record also pins source and replacement profile configuration hashes. Commit replay and bootstrap/readiness/Workspace consumption recheck these pins and the exact copied profile against the current source configuration; changed identity or configuration fails closed, including after application reload. The base profile and accepted model, tool, and provider selections are unchanged. Repeated resolution for the same placement is stable; a changed Pod or Service yields a different profile. Requires current run-bound ReadRunSelection.
GET /internal/projects/{projectId}/runs/{runId}/environments/{environmentId}/coordination/sessions/{sessionId}/runtime-bootstrap/profiles/{profileId}/workspaceReturns EnvironmentRuntimeWorkspaceContext with the current placement, exact validated Workspace mount negotiation, and attached transition revision. One owner lock protects both lease and Workspace during the Core context read. Requires current run-bound ReadRunSelection. This is metadata, not flush or content evidence.
POST /internal/runtime/sources/{runtimeInstanceId}Registers actual immutable SDK facts under the validated bearer and separate observe credential. Rechecks current owner and grant authority after waits.
POST /internal/runtime/observationsCommits a native SDK observation, including optional A2A message correlation, under the exact current registration/source grant. Identical SDK events return the original source receipt. Changed content conflicts.
POST /internal/runtime/actions/numeric-denials/readReads the stored model-turn or tool-call limit denial under current registration, source, root-owner, and Projects authority. RuntimeNumericLimitDenialReadResult requires a nullable receipt and permits an absent or nullable nativeNoSend companion. The current HTTP serializer includes nativeNoSend, including null when no companion exists. A null receipt means the denial is absent; an orphan or mismatched companion fails closed.
POST /internal/runtime/turns/numeric-limit-denials/no-sendAccepts RuntimeNumericLimitNativeNoSendRecordRequest with the current Observe credential, exact model.turn action, and typed companion. Orchestrator reloads the immutable original denial and checks the current source, accepted root, admission, and unchanged owner send state before appending.
GET /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/usage-receipts/{receiptId}Returns the immutable source receipt only after fresh accepted-selection and run-read checks. Events cannot substitute caller-supplied usage.

The numeric no-send companion is limited to a coordinator-root MaxModelTurns authorization denial. AgentHost captures the SDK cursor before authorization, then accepts only a complete empty native-event range whose cursor is unchanged. The request binds the persisted message ID, exact action hash, original denial ID and payload hash, registration, source grant and SDK-session hash, plus equal before/after cursor hashes and a zero event count. It stores hashes only. The companion is a separate immutable ledger row; the original owner denial and its payload hash remain untouched. Host's POST /runtime/v1/turns/numeric-limit-denials/read continues to return the original bare denial receipt, not the internal paired envelope. Child pre-dispatch and in-turn tool denials remain owner-only and do not claim an empty native range.

The staged Environment resume contract uses these authenticated, no-store routes.

Method and pathSource contract
POST /internal/runtime/resume/prepareRuntimeWorkspaceResumeRequest contains the saved manifest and RuntimeSuspendPlacementReleaseRequest. RestoredWorkspace must be absent. Returns RuntimeWorkspaceResumePlacementReceipt for the exact new mount; this is not content verification.
POST /internal/runtime/resume/verifyThe same request requires Core's persisted RestoredWorkspace and current phase version. Returns RuntimeWorkspaceResumeVerificationReceipt only after actual Host tree-hash and fresh owner, placement, and Network checks.
POST /internal/runtime/resume/require-currentCore confirms the exact source manifest, saved producer receipt, resume operation, and phase. With RestoredWorkspace, it also confirms Core's saved complete mount response. Environment and Host retain the original actor.
POST /runtime/v1/workspace/resumeRead-only Host verifier. Returns RuntimeHostWorkspaceResumeReceipt bound to the operation, source manifest, exact new Workspace context, and actual tree hash. It does not configure a model session or recover cache files.
POST /internal/runtime/resume/bootstrapEnvironment accepts Core's phase-4 RuntimeResumeBootstrapRequest. Returns RuntimeResumeBootstrapOutcome with exactly one complete receipt or explicit state-loss proof. It persists successful attempt receipts and freshly rechecks the Host on replay.
POST /internal/runtime/resume/require-bootstrap-currentCore confirms the exact phase-4 operation, saved mount, current Runtime registration, and server-issued attempt. A caller-selected attempt is not authority.
POST /internal/runtime/resume/configurationEvents reads the exact acknowledged server configuration. Native TLS, current Core authority, registration, private material identity, and byte hash are required. Generic and public material reads cannot expose it.
POST /runtime/v1/configure/resume-stateThe Host returns RuntimeResumeHostStateReceipt for the exact operation, manifest, registration, and attempt. Valid states are BootstrapPresent, Activated, and Missing; an omitted or unknown state is rejected.

The request and both Environment clients belong to Agentweaver.Identity. Resume validates the source's private configuration acknowledgment before owner calls or Environment effects. Ordinary suspend receipt validation remains unchanged; missing configuration cannot authorize resume. Prepare and verify use Core phase versions 2 and 3. The target lifecycle is the source plus one; Storage resource and data generations do not change. The final Network generation is the source plus one, not a default readiness counter. The optional bootstrap runtimeEndpoint contains the observed HTTPS Service address, Pod address, Pod UID, and Service UID. The transport pins the observed Pod address and uses ordinary TLS verification for the owned Service name. The complete target context is compared before and after native verification. RuntimeBinding.ResumeOperationId and ResumeAttemptId are paired optional fields. Ordinary bindings omit both, so their existing serialized identity does not change. Resume bootstrap requires the matching attempt and canonical bootstrap, consume, and exchange IDs. A replacement derives from the exact revoked prior registration under the same operation. Core must serialize selection and revocation; an already-issued active attempt survives a lost response. The immutable registration revision stores the attempt without a same-phase update to migration 019 progress. RuntimeResumeBootstrapStateLossReceipt requires a matching delivery receipt and fresh Host Missing proof. The shared bootstrap client returns a valid receipt or throws RuntimeResumeBootstrapStateLostException with that validated proof. Generic denials, timeouts, historical delivery, and saved Host receipts alone cannot authorize replacement or dispatch. RuntimeHostResumeCacheReceipt preserves the original source cache acknowledgment in both recovery modes. native-cache requires the compatible saved cache facts and forbids JournalRebuild. journal-rebuild requires RuntimeResumeJournalRebuildReceipt with the exact saved checkpoint, flushed position, digest, and active attempt. Its only supported native-cache state is PendingUntilAuthorizedTurn; it contains no new cache acknowledgment. The current Host source facts do not need to match the old cache's SDK or Runtime version. The shared digest covers the ordered authenticated session-visible prefix, including valid run-wide position gaps. The producer must verify saved-boundary pagination, material bytes, current authority, and the saved source configuration and cache references. Each TURN must match its own journal payload and single stored object reference, and its material read must match that same reference and event position. The recorded runtime, registration revision, fence, selection, SDK, model, and capacity facts belong to that TURN. They need not match the latest cache or current Runtime. The source-session replay response supplies the saved fork visibility. A direct material read does not make another session visible. A receipt hash alone is not independent proof of those reads. Missing required journal evidence blocks readiness; owner, transport, configuration, hash, and fence failures cannot trigger another-source fallback. The next real authorized turn uses the existing native cache commit path. Suspend before genuine native files exist fails explicitly without a cache success receipt. These source contracts do not prove native TLS, PostgreSQL, mounted contents, or deployed dispatch.

Environment:RuntimeBootstrap:Profiles configures exact owner/profile/provider registrations. Static source lookup takes precedence. With Environment:RuntimeBootstrap:DefaultSourceProfileId configured, the matching default ID can instead derive a source from the authorized Sandbox lease and provider-observed receiver configure endpoint. Its observation endpoint is the Orchestrator owner root plus /internal/runtime/observations; MCP is absent. The default requires bootstrap owner addresses and the AgentHost launch profile. Without that setting, or for an unknown ID, an absent registration still returns runtime_delivery_unavailable. The default never bypasses the immutable, actor-bound replacement or live endpoint verification. No caller supplies a configure URI or observation URI. Runtime bindings separately pin PlacementProviderId, EnvironmentLifecycleGeneration, and EnvironmentLeaseRevision; omitted legacy pins do not change stored binding JSON. Lease expiry bounds registration expiry and cannot be extended by enrollment replay. A resumed placement retains that original profile and saved resume source. Its new configure address is resolved from the currently verified Kubernetes Service and Pod, not another configured placement. Resolve, replacement-ID lookup, and bootstrap/readiness/Workspace reads use the same source resolver. Resume preserves the saved source binding and lease fences. Pod UID and IP changes do not change the source hash when the logical receiver and observation configuration are unchanged. Changed source configuration fails closed; bootstrap profiles and their hashes contain no credential material.

Current Projects policy deliberately withholds WriteProjects from run-bound tokens. The public placement route still denies those tokens. The internal read-only lookup uses existing ReadRunSelection authority and exact current run/tenant binding. It reads no selection recursively and dispatches no provider effects. The profile callback retains the lease transaction while it reads current work-item context. Configure delivery still requires Identity's independently verified pending nonce.

The auth-first runtime library validates the configuration hash and exact configure audience before consuming a delivered nonce. The current registration supplies the accepted model reference. Native session creation uses an explicit session token and the SDK's empty-mode policy; URI mode does not accept client-wide login options. The SDK-reported effective model must match the registered selection. No ready session is returned before the final registration, source-credential, and lifetime checks. Controlled TCP tests exercise the actual SDK RPCs and usage callbacks. The combined harness also commits source receipts and prices them through Events HTTP. Only a source receipt ID crosses the accounting admission route. No caller supplies a price or multiplies weighted nano-AIU again. The ledger preserves explicit Estimate, Reconciled, and Unpriced dispositions.

RuntimeActionRequest optionally carries DispatchId for model.turn and IsToolInvocation for registered pre-tool hooks. A configured model-turn cap requires the exact prepared dispatch, runtime binding, and prompt hash. The default false invocation flag and null dispatch ID stay omitted from historical payloads and hashes. After current Policy allows a tool invocation, Orchestrator reserves its event ID and request hash in the existing outbox. Reservations use the run-level runtime-tool-invocations ledger stream, separate from session message streams, so retained reservations do not block addressed-message delivery. MaxToolCalls counts those reservations across the whole run, including after store restart. Exact HTTP retry reuses the event ID; a new invocation cannot reuse an arguments hash as identity. Permission callbacks do not debit another slot. Verify requires the retained exact reservation before dispatch.

The accepted project MaxPromptTokens value is preserved in RuntimeOwnerContext and the runtime binding; it is not silently discarded or reclassified as a Knowledge retrieval budget. When configured, AgentHost resolves the effective prompt capacity from the accepted limit and the concrete model capacity, including any lower server limit, then passes it to the native SDK as a compaction threshold. For BYOK, the server-owned model binding supplies the concrete capacity; unavailable capacity rejects activation with runtime_model_prompt_capacity_unavailable. The pinned SDK compacts removable history. For an irreducible latest turn, it may send a provider request during compaction and then report a capacity-attributed query error. This is not a hard admission check for every internal provider request or a no-send guarantee, and input is not silently truncated.

Optional SdkSessionFacts.MaxPromptTokens records the effective native SDK compaction threshold, not aggregate token usage, a per-request admission guarantee, or a raw-request token count. The session-material owner binds this source fact and rejects a changed value. Absent optional pins preserve historical payloads; they do not authorize a configured-capacity resume. Native and hosted deployment evidence is still required to verify these capacity and compaction guarantees.

GET /internal/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/runtime-owner-context requires the authenticated current run owner and returns Cache-Control: no-store. The response contains the active child turn, accepted revisions and hash, and agent/model reference from its confirmed WorkPlan item. For a Fixed workflow step, the agent, model reference, and step come from the running association in the root's owner-created coordinator-execution checkpoint. The association must match the active child and current accepted selection, execution fence, and decision version. The accepted platform or project selection also supplies ModelSourceMode. Runtime registration and model-grant receipts retain that mode. Missing or incompatible modes deny SDK startup without a personal provider fallback. Hosted selections carry a stable connection ID and its accepted project or platform scope. Identity resolves the current connection revision and exact secret version for each model-session grant. BYOK selections carry an exact SecretRef only when the WorkPlan model matches the accepted model. Slot-backed selections also carry ModelCredentialIdentity, which binds the slot, scope, project when project-scoped, and provider. Identity matches the identity and exact reference against enabled ledger history, then uses the recorded vault. A pin to an enabled historical version remains usable after slot disable. The reference and identity are metadata, not a grant or credential value. An unknown, unmapped, inactive, stale, or non-dispatchable child is unavailable. Caller configure JSON cannot set these fields.

An accepted revision-backed BYOK selection also carries its ModelProviderBindingRevision and immutable Events RuntimeRateCardPin. Public Gateway acceptRunSelection and getRunSelection responses omit credentialReference and providerBindingRevision.credentialVersion while preserving identity, pricing pins, and unrelated sourceControl fields; Projects & Config and internal Orchestrator reads retain the full snapshot. Both PUT /api/projects/{projectId}/runs/{runId}/selection and PUT /api/projects/{projectId}/runs/{runId}/interactive-selection lock the distinct slot-backed BYOK provider heads used by the primary and task selections in provider_id order (FOR SHARE) through commit. When ProjectsConfig:AdmittedRunModelEgressEnabled is true, interactive admission records each owner-authorized, revision-bound direct BYOK model host (NetworkEgressPurpose.ModelEndpoint, Fqdn, TCP port 443) plus required NetworkEgressPurpose.DnsResolver (KubernetesService, kube-system/kube-dns, TCP/53 and UDP/53) rules in EffectiveRunSelection.RequiredEgress when at least one valid direct model host is present, and validates them against the platform baseline and project narrowing: when resolved RunLimits.MaxChildren is 0, only the root selection (ModelSelection) is included; when MaxChildren > 0, eligible task, role, and agent selections (ModelSelections) are also included in the shared run snapshot. Runs that use HostedCopilot or lack a revision-bound direct BYOK binding keep RequiredEgress empty. On a confirmed serialization failure (40001) or run-selection primary-key collision (PK_project_run_selections), Projects retries up to three attempts in a fresh transaction and rechecks current project, tenant, role, and binding authority before returning an exact-fingerprint replay; exhausting three attempts returns 409 Conflict, and cancellation, unrelated errors, or unknown commit outcomes propagate without replaying the write. Orchestrator requests one RuntimeRateCardAdmission for each effective provider/model/effort pair before first dispatch. Events verifies the exact provider revision, model pin, and card content and provenance. The runtime owner context returns the admission that matches the selected model and effort. Events stores cost pins by provider and model identity; it keeps the aggregate byok.tokens meter unchanged. This admission does not use a hosted Copilot quote or replace the hard USD BYOK budget.

Identity extracts only the current user access token from its protected hosted envelope before the Host receives a response. BYOK sessions supply explicit SDK provider configuration and skip Copilot authentication and catalog lookup. Hosted receipts bind the current connection identity, revision, scope, credential kind, freshness, and exact secret version. Every asynchronous redemption and SDK preparation boundary revalidates that proof. Rotation changes the credential revision, not the immutable accepted selection. Controlled native transport evidence does not prove GitHub entitlement or deployed connection services. BYOK usage retains token measurements and rejects Copilot nano-AIU attribution. BYOK selections also retain the server-owned ModelBindingPin, including its provider type and configuration hash. The Host compares this pin before SDK use. A missing or changed pin denies the session without a hosted fallback. SdkSessionFacts.ByokProvider records the actual provider type, effective deployment ID, and accepted configuration hash. The deployment ID must equal both source and usage model IDs. Core rejects missing input/output measurements, changed provider facts, and Copilot units. The controlled Azure fixture proves a dispatched native usage event through Broker, Core PostgreSQL, and reference-only Events accounting. This proof does not authorize paid Azure calls. Without an admitted Cost provider, its accounting remains Unpriced, not zero-cost or hard-bound admission proof.

Projects & Config authorization context ​

This route belongs to the unpublished Projects & Config candidate. It resolves only the validated caller's issuer and sub; it does not accept caller-subject or role selectors, issue grants, or mutate authority.

Method and pathContract
GET /api/authorization/contextVersioned current effective permission context, filtered by the validated audience, api.read scope, purpose, optional tenant selector, and project/run bindings. Returns Cache-Control: no-store.
GET /api/authorization/target-contextCurrent unbound PlatformAdmin context and Projects database namespace ID. Requires api.read and an active selected tenant membership.
GET /api/authorization/projects/{projectId}/model-pricing-searchEvents-only current role check. Requires api.read, rejects conflicting project and run bindings, and returns 204 only for current PlatformAdmin or exact Owner authority on the requested project. Returns Cache-Control: no-store.
GET /api/projects/{projectId}?runId={runId}Read project metadata for an exactly matching run-bound token after fresh current ReadProjects authorization. Purpose-bound, unbound, or mismatched tokens and duplicate/unknown query parameters are denied; the response is Cache-Control: no-store.
POST /internal/projects/{projectId}/runs/{runId}/broker-run-bindingPrivate Broker-only proof read, enabled only when ProjectsConfig:Authentication:BrokerRunBindingAudience is configured. It requires native TLS 1.2 or TLS 1.3, accepts no query or body, and returns a bounded Cache-Control: no-store receipt only for the active project, current actor membership, active Orchestrator assignment, exact project/run token binding, and matching run selection. After it confirms current membership and project visibility, a missing Orchestrator role returns 403 orchestrator_role_required; a missing run selection returns 404 run_selection_not_found after current membership, project visibility, and Orchestrator role checks. Other project and membership denials retain generic error codes.
GET /api/projects/{projectId}/runs/{runId}/spend-budgetsOrchestrator-only read of CurrentProjectSpendBudgets. Requires api.read, the Orchestrator scope and current role, an exact project/run binding, and an accepted run selection. Resolves project-scope budgets from the current project and platform revisions, so a changed project budget applies to the next dispatch of every run. Returns Cache-Control: no-store.

Contract version 1 contains the caller and selected tenant, current membership revision, optional project/run binding, and grouped effective permissions with their current role revisions. It omits assignment IDs and raw role rows. Purpose-bound tokens are denied; resource services must request fresh context for each privileged operation and must not cache or pin it.

The target-context route accepts no query parameters or request body. It selects the sole active membership, or the active membership named by a single X-Agentweaver-Tenant header. Signed tenant assertions must match the selected tenant. The route rejects purpose-, project-, and run-bound tokens. projects.admin is not required for this read.

The version 1 response contains issuer, actorId, tenantId, membershipRevision, null boundProjectId and boundRunId, effectiveAuthority, and a nonempty lowercase UUID installationId. installationId identifies the Projects database namespace, not a tenant, cluster, deployment, OAuth client, or GitHub App. Tenants and clusters that share a Projects database share the namespace. Effective permissions reflect the caller's scopes; the list can be empty.

Projects locks and rechecks the membership and PlatformAdmin assignment, then reads current grants and the namespace in the same transaction. The Gateway validates the bounded response against the caller's identity and tenant. Both routes return Cache-Control: no-store and X-Content-Type-Options: nosniff. Errors use a fixed application/problem+json body with type, title, status, and code. Unsupported methods, query parameters, and request bodies return 400 request_shape_invalid before authentication; authentication failures return 401 authentication_required; access failures return 403 target_context_forbidden; an unavailable namespace returns 503 target_context_unavailable. Gateway contract failures return 502 owner_contract_invalid, transport failures return 502 owner_unavailable, and timeouts return 504 owner_timeout. The Gateway does not relay owner error bodies. Target-context request queries and database exception details are not logged.

Platform components report ​

PlatformComponentReport in Agentweaver.Abstractions is the shared record for GET /api/v1/platform/components. Each owner service returns a PlatformComponentOwnerReport from GET /internal/platform/components. For behavior and examples, see Platform components.

Method and pathContract
GET /api/platform/componentsProjects & Config requires api.read, an unbound non-purpose token, and a current TenantAdmin assignment for the caller's tenant or a current PlatformAdmin assignment. It asks the five owners in parallel with a three-second limit each, then returns all 16 areas in catalog order with Cache-Control: no-store.
GET /internal/platform/componentsOwner-only route, mapped only when PlatformComponents:ServiceAuthentication is configured. It accepts only a token for the private audience whose sub equals the configured Projects caller subject. Not in the Gateway OpenAPI document.

The report rules are:

  • Every area is present. A missing, failed, slow, or invalid owner answer makes each of its areas unknown with reason ownerUnavailable.
  • Projects never reports a configured value as active without the owner's answer.
  • Canvas is always notAvailable with reason noBackendOwner.
  • An area's readiness is the least ready value among its active implementations. An area with nothing selected is disabled with reason notSelected.
  • The report contains no option values, option revisions, endpoints, credentials, or resource identifiers.

Projects & Config host configuration ​

For complete deployment-setting guidance, see Runtime configuration.

KeyRequirement
ProjectsConfig:Authentication:BrokerRunBindingAudienceOptional, distinct HTTPS audience for the private Broker proof route. When configured, the route requires its TLS certificate, private key, and server-certificate digest.
ProjectsConfig:Tls:CertificatePath / KeyPathAbsolute paths to the existing Projects server certificate and private key. The certificate must be current, non-CA, and valid for server authentication.
ProjectsConfig:Tls:ServerCertificateSha256SHA-256 hex digest of the exact leaf certificate DER used by Kestrel.
ConnectionStrings:ProjectsConfigMigrationSeparate password-free PostgreSQL connection for --migrate, --bootstrap-first-tenant-admin, and --bootstrap-first-platform-admin. Its Entra role must own the Projects & Config schema and migration history.
ProjectsConfig:Migration:AccessTokenOptional short-lived PostgreSQL Entra access token for the explicit migration connection. The command supplies it as the PostgreSQL password. Keep it in a short-lived Secret or environment variable, never in arguments or logs.
ProjectsConfig:Migration:WorkloadIdentity:{TenantId,ClientId,TokenFilePath}Explicit migration workload identity used by --migrate and both bootstrap commands. The automated Kustomize migration Job uses this identity from a pre-provisioned ServiceAccount. Configure either this identity or ProjectsConfig:Migration:AccessToken, not both.
ProjectsConfig:Authentication:Authority and ProjectsConfig:PrivilegedSetup:{ApprovedIssuer,ApprovedSubject,ApprovedTenantId}The approved identity and tenant for the first TenantAdmin and PlatformAdmin. The approved issuer must match the authentication authority. Neither command accepts a different identity as an argument.

The deployment profile also configures Kestrel's default certificate paths. Those paths and the Projects TLS settings must identify the same certificate. The service accepts the private proof request only after native TLS 1.2 or TLS 1.3; forwarded HTTPS headers are not proof.

Run dotnet Agentweaver.Projects.Config.dll --bootstrap-first-tenant-admin once as an operator after the first deployment. The command uses only the approved identity settings and the separate migration connection. It creates the active tenant membership, TenantAdmin assignment, and authority audit rows in one transaction. It exits without changes when that identity already has the active grant. It refuses when another active TenantAdmin exists. Normal host startup never runs this command.

Run dotnet Agentweaver.Projects.Config.dll --bootstrap-first-platform-admin once after the Projects & Config schema has been migrated. The command verifies the migration history, then creates the approved identity's active PlatformAdmin assignment and audit row in one transaction, reusing its active tenant membership when present. A rerun is a no-op only when that identity is the sole active PlatformAdmin; any other active PlatformAdmin stops the command. Normal host startup never runs it.

For a cluster bootstrap, run npm run db:maintenance:projects-config with --bootstrap-first-tenant-admin or --bootstrap-first-platform-admin. The runner creates one Job from the Projects & Config migration template and uses the target's verified projects-config-migration Workload Identity. It reads the configured admin subject from the immutable runtime ConfigMap. It does not require an operator PostgreSQL token or create a credential Secret. See Bootstrap the first TenantAdmin and Bootstrap the first PlatformAdmin.

The runtime database principal is read-only on authority tables, with one exception. Authorized Projects & Config operations can insert project role assignments and matching authority_audit rows; the role-assignment API can also mark assignments revoked. Project creation grants its authenticated creator active Owner authority in the same transaction as the project and initial configuration. The APIs, not the database grant, enforce who can make these changes: project creation rechecks current TenantAdmin authority in a Read Committed transaction, while role assignment and revocation recheck it in a serializable transaction. The runtime principal can't delete authority rows or write tenant memberships and tenant-level roles. See Runtime authority writes for the exact grants and Project role assignments for the routes.

Knowledge and Memory ​

These routes belong to the unpublished Agentweaver.Knowledge .NET 10 service candidate. Protected routes require the configured OpenIddict issuer and audience. Each privileged request forwards its original validated bearer token to Projects & Config for a fresh authorization-context check; Knowledge does not keep memberships, roles, or authorization caches. Private content reads and writes require fresh effective AccessPrivateKnowledge for the target project; ReadProjects alone is metadata-only and does not authorize private Knowledge records, revisions, or context. A run-bound project Owner with projects.admin retains this Knowledge-specific permission but not generic WriteProjects. A run-bound Owner also receives it with api.read and projects.orchestrator when the same current project has an Orchestrator assignment and the token is bound to the exact project/run. Memory-provider resolution for run-scoped routes additionally requires effective project ReadRunSelection. If the validated caller token is already bound to a project/run, those bindings must match the requested route and the authority response.

Project-wide discovery uses an unbound Broker token with current effective AccessPrivateKnowledge for the project or its tenant. It searches all agents through existing run-provider bindings and reads each Memory selection through the private Knowledge-selection route. It does not require ReadRunSelection, grant general run-selection access, or create a binding for a run that has no Knowledge pin.

Method and pathContract
GET /health/liveProcess liveness.
GET /health/readyPostgreSQL and current owned-schema readiness; returns 503 when migrations, tables, or required runtime grants are missing.
GET /api/projects/{projectId}/knowledge/records?kind={kind}&state={state}&q={text}&includeInactive={bool}&page={n}&pageSize={n} (Gateway: /api/v1/projects/{projectId}/knowledge/records)Search every agent across existing run-provider bindings and globally page the merged results. Requires current effective AccessPrivateKnowledge; ReadRunSelection is not required. state=pending is supported only with kind=proposal, and includes pending proposals regardless of includeInactive; other state filters return 400. Rejects run-bound tokens. Each item returns accessRunId, the existing run binding used to authorize history reads, separately from record.sourceRunId provenance.
POST /api/projects/{projectId}/runs/{runId}/agents/{agentId}/recordsCreate a Memory, SessionContext, or Proposal record. Requires one Idempotency-Key; a new write returns 201, an identical retry returns 200, and reuse with different request content returns 409.
GET /api/projects/{projectId}/runs/{runId}/agents/{agentId}/records?kind={kind}&q={text}&includeInactive={bool}&page={n}&pageSize={n}Search only the requested project and agent, with bounded pages; requires current AccessPrivateKnowledge for private content.
GET /api/projects/{projectId}/runs/{runId}/agents/{agentId}/records/{recordId}Read one record in the requested project/agent scope; requires current AccessPrivateKnowledge for private content.
PUT /api/projects/{projectId}/runs/{runId}/agents/{agentId}/records/{recordId}Append a revision using expectedRevision compare-and-swap and an Idempotency-Key; stale revisions return 409. You can archive Memory and Decision records, but you can supersede only Decisions; the replacement link must identify a Decision.
GET /api/projects/{projectId}/runs/{runId}/agents/{agentId}/records/{recordId}/revisions?page={n}&pageSize={n}Read bounded immutable revision history; requires current AccessPrivateKnowledge for private content.
POST /api/projects/{projectId}/runs/{runId}/agents/{agentId}/records/{recordId}/restoreBody selects a historical revision and supplies current expectedRevision plus optional reason; with an Idempotency-Key, appends a new head rather than rewinding history. The restored record is Active+Pending; a Decision requires explicit approval before it is trusted again.
POST /api/projects/{projectId}/runs/{runId}/agents/{agentId}/records/{recordId}/approveExplicitly approve an Active Pending or Legacy Decision using expectedRevision, optional reason, and an Idempotency-Key; appends an approval revision. This does not promote a proposal or deliver an accepted project fact.
GET /api/projects/{projectId}/runs/{runId}/agents/{agentId}/records/exportNo-store export of the exact project/agent's Memory and Decision records with complete immutable revision chains in agentweaver.knowledge-transfer.v1 schema 1; bounded to 25 records, 500 revisions, and 1 MiB.
POST /api/projects/{projectId}/runs/{runId}/agents/{agentId}/records/importImport a version-1 transfer bundle whose project and agent must match the authorized route; requires an Idempotency-Key. Preserves transferred history and appends an imported revision, setting current records Active+Pending. Unsupported/incomplete input returns 400, collisions or graph conflicts return 409, and size-limit violations return 413; initial and identical requests return 201 and 200.
POST /api/projects/{projectId}/runs/{runId}/agents/{agentId}/proposals/{proposalId}/promoteRequires current AccessPrivateKnowledge; explicitly promote an owned pending proposal using its expected revision and an Idempotency-Key. Events separately requires current WriteProjects, so the response can report PENDING without undoing the committed promotion. An identical retry uses the same immutable receipt.
POST /api/projects/{projectId}/runs/{runId}/agents/{agentId}/proposals/{proposalId}/rejectExplicitly reject a pending proposal using its expected revision and an Idempotency-Key.
GET /api/projects/{projectId}/runs/{runId}/agents/{agentId}/context?q={text}&maxItems={n}&maxTokens={n}Compose bounded context with immutable revision references; requires current AccessPrivateKnowledge for private content. Invalid narrowing is 400; mandatory-content, candidate, or output budget overflow is returned explicitly as 413.
GET /internal/accepted-effects/{receiptId}Legacy no-store redacted accepted-effect receipt from native PostgreSQL for the original issuer/subject and matching bounds, after a fresh current project WriteProjects check. Does not return proposal or decision content.
GET /internal/projects/{projectId}/runs/{runId}/accepted-effects/{receiptId}Current no-store redacted receipt scoped to the selected, already-pinned Memory provider and exact project/run; requires current WriteProjects. A missing or changed immutable provider binding fails closed without creating a replacement or falling back to the legacy route.

The service owns a separate knowledge PostgreSQL schema. Revisions are append-only, provider bindings are immutable, and current records cannot be physically deleted; record changes use expected revisions. Restore appends a new revision based on a historical snapshot and never removes later history. Decision restore resets trust to Pending; a separate explicit approval appends the approval revision. Versioned transfers preserve the complete Memory/Decision revision chains and provenance while rejecting ID collisions instead of merging record heads; imported records are Active+Pending. Proposal promotion checks current AccessPrivateKnowledge, agent ownership, source run, pending state, and expected revision. It commits the proposal revision, approved decision, redacted immutable receipt, and Knowledge-owned outbox intent in one transaction. Events fetches the receipt and appends a separate project fact; this is not a native Sessions journal event. Failed delivery remains PENDING until a fresh authorized caller retries.

For complete runtime-setting guidance, see Runtime configuration.

Configuration:

KeyRequirement
Identity:IssuerAbsolute HTTPS issuer used to validate callers.
Identity:AudienceRequired bearer-token audience for Knowledge.
ProjectsConfig:BaseAddressTrusted absolute HTTPS Projects & Config owner URI; redirects are rejected.
Knowledge:Events:BaseAddressFixed absolute HTTPS Events owner URI for caller-driven project-fact delivery; redirects are rejected.
Knowledge:Events:AudienceRequired Events audience for the already-issued caller bearer; a missing audience returns delivery as PENDING with the subject/audience tuple.
ProjectsConfig:ProviderCatalogThe catalog owner's startup snapshot used to validate negotiated provider metadata.
ConnectionStrings:KnowledgePasswordless PostgreSQL runtime connection to the Knowledge-owned schema.
Knowledge:Database:WorkloadIdentity:{TenantId,ClientId,TokenFilePath}Explicit projected workload identity for the runtime Entra database role.
ConnectionStrings:KnowledgeMigrationSeparate connection for the explicit --migrate operation.
Knowledge:Migration:WorkloadIdentity:{TenantId,ClientId,TokenFilePath}Separate explicit migration workload identity.
Knowledge:Provider:{ResourceId,DatabaseName,ResourceGeneration,Schema,OptionsRevision,OptionsSchemaVersion}Expected resource identity and immutable provider options used during negotiation/pinning.
Knowledge:CosmosProvider:{Endpoint,DatabaseId,ContainerId,ResourceId,ResourceGeneration,OptionsRevision,OptionsSchemaVersion}Optional Cosmos Memory adapter configuration. The catalog must register the adapter and a run must select it; negotiation requires the existing container partition key /projectId, the search composite index, and a non-expiring default TTL. The schema version defaults to 1. These settings do not provision Cosmos resources.
Knowledge:RedisProvider:{Endpoint,ResourceId,ResourceGeneration,OptionsRevision,OptionsSchemaVersion,Database,KeyPrefix,UserName,Password}Optional Redis Memory adapter configuration. The catalog must register redis.memory and a run must select it. Endpoint must be an absolute rediss:// URI with an explicit port; ACL username/password must be paired. Negotiation requires a standalone Redis 6+ primary with healthy AOF-always persistence, noeviction, no replicas or cluster, and persistent namespace data. Defaults are schema version 1, database 0, and key prefix agentweaver:knowledge. These settings do not provision Redis resources.
Knowledge:Context:{MaximumCandidates,MaximumItems,MaximumTokens}Service-owned hard limits; each request can only narrow them, and a configured run prompt-token limit can only narrow the context-token ceiling further.

Both PostgreSQL connections omit passwords and use TLS VerifyFull with the PostgreSQL Entra token scope. Ordinary startup verifies the already-applied schema and requires the runtime identity to have only the necessary DML grants; it cannot migrate. Run the executable with only --migrate to use the separate privileged identity. See Knowledge and Memory for ownership, context, and current event-delivery boundaries.

Identity host configuration ​

For complete deployment-setting guidance, see Runtime configuration.

KeyRequirement
ConnectionStrings:IdentityBrokerIdentity-owned PostgreSQL database for runtime access. Use the separately bootstrapped Entra runtime role and omit a password; ordinary startup verifies but does not migrate.
IdentityBroker:IssuerAbsolute HTTPS issuer.
IdentityBroker:Signing:PfxPathMounted signing, encryption, and data-protection certificate.
IdentityBroker:Signing:PfxPasswordDeployment secret. Do not store it in source control.
IdentityBroker:DataProtectionKeyPathDurable writable key-ring path shared by broker replicas.
IdentityBroker:ExternalProvider:AuthorityAbsolute HTTPS OIDC authority.
IdentityBroker:ExternalProvider:ClientId and ClientSecretRegistered upstream confidential client.
IdentityBroker:ClientsRegistered client IDs, types, redirect URIs, scopes, resources, and secrets.
IdentityBroker:WebOriginOptional normalized HTTPS origin of the Web application; required when IdentityBroker:GitHubRepoApp is configured.
IdentityBroker:SecretRedemption:AudienceRequired HTTPS audience registered as a client resource.
IdentityBroker:SecretRedemption:VaultUriAzure Key Vault root URI.
IdentityBroker:SecretRedemption:WorkloadIdentityTenantIdExplicit Entra tenant ID.
IdentityBroker:SecretRedemption:WorkloadIdentityClientIdExplicit Entra client ID.
IdentityBroker:SecretRedemption:WorkloadIdentityTokenFilePathAbsolute projected token-file path.
IdentityBroker:RunBinding:ProjectsOwnerAddress / ProjectsAudienceFixed absolute HTTPS Projects & Config owner root and the distinct private audience used for short-lived Broker-to-Projects run-binding proof requests.
IdentityBroker:RunBinding:ProjectsTrustBundleSha256SHA-256 of the exact raw UTF-8 PEM bytes at the fixed /var/run/service-backend-ca/ca.crt path. The bundle must contain CA certificates only and is used as the custom trust root for Projects.
IdentityBroker:RunBinding:ProjectsServerCertificateSha256SHA-256 hex pin of the Projects leaf certificate DER bytes. Broker also checks hostname, validity, server authentication purpose, and the custom-root chain; redirects are disabled.
IdentityBroker:RemoteMcpOAuth:ProjectsOwnerAddressFixed absolute HTTPS root for current Projects authorization and project status.
IdentityBroker:RemoteMcpOAuth:EnvironmentOwnerAddressFixed absolute HTTPS root for Environment connection configuration reads and identity-binding updates. Both Remote MCP owner addresses are required when this section is configured.
IdentityBroker:RemoteMcpOAuth:Providers[n]Each fixed provider has exact IssuerUri, ClientId, RedirectUri, and nonempty ApprovedResources, ApprovedOAuthEndpoints, and ApprovedScopes. Consent metadata reads use only the exact approved resource and issuer URLs, reject redirects, and accept discovered authorization/token endpoints only when they exactly match ApprovedOAuthEndpoints.
IdentityBroker:GitHubRepoApp:OAuthClientId / OAuthClientSecretRegistered GitHub OAuth client used only for the Repo App user connection; the secret is deployment configuration, not a database value.
IdentityBroker:GitHubRepoApp:CallbackUriAbsolute HTTPS /auth/github/repo-app/callback URI with no query, user info, or fragment.
IdentityBroker:GitHubRepoApp:AppId / AppSlugExact configured GitHub App identity and install URL slug.
IdentityBroker:GitHubRepoApp:PrivateKeySecretId / PrivateKeySecretVersionExact protected App key reference redeemed inside Identity for the active run; the key value is never returned or stored in Identity tables.
IdentityBroker:RuntimeBootstrap:OrchestratorOwnerAddress / EnvironmentOwnerAddressOptional composition; both fixed HTTPS root owner addresses are required when configured.
IdentityBroker:RuntimeBootstrap:BootstrapLifetime / SourceLifetimeExplicit positive lifetimes bounded by the current registration and actor expiry.

The host does not use ambient credentials or a development-certificate fallback.

ProjectsConfig:Authentication:BrokerRunBindingAudience is an optional, distinct absolute HTTPS audience. Configuring this audience activates the private run-binding route. Projects & Config validates its short-lived signed Broker request tokens separately from public bearer tokens.

For the foundation deployment, the optional descriptor has exactly four fields: projectsOwnerAddress, projectsAudience, projectsServerCertificateSha256, and projectsTrustBundleSha256. Configure the corresponding existing Broker and Projects & Config runtime settings in the root Kustomize overlay. Apply the overlay with the ordinary Kubernetes deployment procedure after reviewing the certificate fingerprints, runtime values, and operator-owned TLS resources. Never read or copy tls.key into a ConfigMap or descriptor.

Identity PostgreSQL access ​

Runtime and schema migration use separate connection strings, projected workload identities, and Entra PostgreSQL roles. Both connections use passwordless async Npgsql token acquisition, VerifyFull, and the scope https://ossrdbms-aad.database.windows.net/.default.

OperationConfigurationPostgreSQL role and boundary
Ordinary runtimeConnectionStrings:IdentityBroker; IdentityBroker:SecretRedemption:WorkloadIdentityTenantId, WorkloadIdentityClientId, and WorkloadIdentityTokenFilePath.The operator-selected runtime Entra role has CONNECT, schema USAGE, DML on current Identity/OpenIddict tables, and SELECT on the migration history. It does not own the schema or apply migrations.
Explicit migrationRun the executable with only --migrate; provide ConnectionStrings:IdentityBrokerMigration, IdentityBroker:Migration:RuntimeRole, and IdentityBroker:Migration:WorkloadIdentityTenantId, WorkloadIdentityClientId, and WorkloadIdentityTokenFilePath.A separate migration Entra role owns identity_broker, applies migrations, and applies the canonical explicit table grants to the named runtime role. Its workload identity receives no Azure resource role.

The database bootstrap and reviewed grant SQL are operator-run steps. The ordinary host checks that the schema exists and no migrations are pending; it fails rather than creating roles or changing the schema. The four runtime grant tables have narrower masks: grant heads allow SELECT, INSERT, and UPDATE; revisions, operations, and receipts allow only SELECT and INSERT. Runtime deletion, audit updates, schema creation, and migration-history writes remain forbidden.

AKS Application Routing preview ​

appRoutingDnsZoneResourceIds is an optional full-foundation input. Empty input requests AKS's managed default domain. One to five unique existing public or private DNS zone IDs request custom domains and disable that default. IDs must belong to the exact authorized subscription, cannot name PrivateLink zones, and can use at most one resource group per zone kind. The existing-cluster aks-redeploy.bicep path does not accept this input or change routing configuration.

The full-foundation appRoutingDomain output has managedDefaultRequested and domainName fields. For an empty zone list, the template returns the exact defaultDomain.domainName from the AKS response. For custom zones, it returns domainName: null. The AKS-only output reports the existing defaultDomain.enabled and defaultDomain.domainName values, or false and null when AKS omits defaultDomain. Neither path constructs hostnames or configures HTTP routes.

The appRoutingIdentity output is separate from foundationProbeIdentity. It contains the AKS-generated resourceId, clientId, and objectId.

RoleScope
Key Vault Certificate User (db79e9a7-68ee-4b58-9aeb-b90e7c24fcba)The existing Key Vault resource.
DNS Zone Contributor (befefa01-2a29-4197-83a8-272ff33ce314)Each exact configured public DNS zone.
Private DNS Zone Contributor (b12aa53e-6015-4669-85d0-8515ebb3ae7f)Each exact configured private DNS zone.

The AKS source uses the Preview 2026-07-02-preview API, enables the Key Vault CSI provider, and sets secret rotation to 'true' with a '2m' poll interval. These are source definitions. No live role assignment, addon activation, domain, certificate, or route was verified.

Azure operator command ​

The supported tool reads the exact subscription and tenant supplied by the operator. Deployment requires separate approval for its target and cost.

Run a non-mutating summary with node scripts/azure/deploy.mjs and reviewed target arguments. Add --execute only after approval. The checked-in parameter examples contain placeholders.

External acceptance evidence ​

The Foundation Probe Job reports its resource-operation results, but it does not attest to its own pod identity, pulled image, or exit status. The separate read-only consumer observes the completed Job and pod. It checks their ownership and workload-identity projection. It also verifies that the Job image and observed pulled image match the expected registry manifest.

The consumer validates the native probe receipt against the admitted source SHA, Git tree, deployment, identity, and target. It then queries Azure Monitor only after Job completion. It requires fresh AppDependencies or AppRequests evidence correlated by source SHA, Git tree, nonce, trace, and span. Configuration checks do not substitute for this runtime proof. Incomplete or mismatched evidence remains blocked. Local fixtures validate the consumer contract but do not prove a live deployment.

Project skill content ​

Projects & Config validates skill markdown and text resources before storage. POST /api/skills/preview returns a content digest without storing the upload. POST /api/skills/package accepts exactly one of files (relative paths and base64 content), archive (a base64 ZIP), or draft (name, description, and instructions). It returns one package for each SKILL.md root, with the candidate, its preview, a per-skill error, and the binary or oversized paths it skipped. The upload is limited to 1,024 files and 2 MiB, and it stores nothing. Pass each candidate and digest to the import route. POST /api/projects/{projectId}/skills/import stores a new immutable revision and returns its receipt. The request supplies the expected digest, an idempotency key, and optional expected revision and source provenance. A repeated key with different request data or a stale revision returns a conflict.

Marketplace-selected content uses separate owner routes and versioned Gateway aliases:

  • POST /api/projects/{projectId}/skill-marketplaces/sources/{sourceId}/preview (Gateway: POST /api/v1/projects/{projectId}/skill-marketplaces/sources/{sourceId}/preview) accepts expectedSourceRevision, resolvedCommitSha, and selectedPath. It returns validation metadata and a content digest, not the selected file bytes.
  • POST /api/projects/{projectId}/skill-marketplaces/sources/{sourceId}/import (Gateway: POST /api/v1/projects/{projectId}/skill-marketplaces/sources/{sourceId}/import) accepts the same source selection plus idempotencyKey and the previewed expectedContentDigest. Optional skillId and expectedRevision target an existing skill revision. The owner returns the persisted revision receipt and records source provenance from its current source row and the pinned commit/path.

These requests contain no file bytes and accept no query parameters. Projects & Config fetches selected files at the supplied resolved commit, checks current actor and project authority, then rechecks the source revision. Gateway forwards the validated bearer and optional tenant selector and preserves owner statuses and response bodies. Gateway limits these request bodies to 3 MiB, matching the inline preview and import routes. Owner Problem Details report invalid requests or content as 400. They report missing projects or sources as 404. They report stale source/skill revisions, digest changes, or idempotency conflicts as 409. They report oversized source data as 422, content-store integrity errors as 500, and malformed upstream data as 502. They report unavailable source/content storage as 503 and upstream timeouts as 504. Runtime-loaded status is not part of these contracts.

GET /api/projects/{projectId}/skills?cursor={token}&pageSize={n} lists stored skill revision metadata and exact current assignments. It includes unassigned and revoked revisions, source provenance, and the current project configuration revision. Omit cursor for the first page. The response supplies a URL-safe opaque nextCursor when another page is available. Cursors bind the project, page size, and versioned skillId-ascending/revision-descending order; clients must forward them unchanged. Pages are bounded: the default size is 25 and the maximum is 50. Newly inserted rows before a cursor do not shift later pages; restart without a cursor to include them. Current tenant administrators and project owners can read active or archived project metadata while their authority remains current; Viewers and callers with revoked or stale authority are denied. The endpoint returns no skill instructions, resource bytes, or storage object keys. Revoked metadata does not permit runtime use.

PUT /api/projects/{projectId}/skills/{skillId}/assignment appends a project configuration revision. An enabled SkillCatalogSetting includes the exact revision, lowercase SHA-256 contentDigest, and non-empty agentIds assigned to current project cast agents. POST /api/projects/{projectId}/skills/{skillId}/revisions/{revision}/revoke permanently revokes that immutable revision. GET /api/projects/{projectId}/runs/{runId}/agents/{agentId}/skills returns the accepted content only after current Orchestrator authority and run binding checks. It does not grant tool or runtime permission.

The uploaded SKILL.md and bundled resources are stored as one immutable object. Configure ProjectsConfig:SkillContent:ContainerUri with an explicit HTTPS container URI and grant the Projects Config workload identity Blob Data Contributor on that container only. Missing storage configuration or missing/corrupt objects fail closed.

Local prompt and content scan report ​

PromptContentScanner.Scan evaluates one exact UTF-8 input with the pinned Microsoft.AgentGovernance 4.0.0 .NET evaluator from AGT commit 7bd5b44339db08e8b96bc2ecdb6fadf28f313450. The scanner runs locally and makes no network or model calls. It returns PromptContentScanReportV1. The Projects & Config Skill admission service uses owner-generated reports to decide whether project content can be previewed, packaged, imported, assigned, accepted for a run, or returned to a runtime.

Each report binds the lowercase SHA-256 digest and byte count to an input kind, owner kind and ID, owner revision, canonical relative path, provenance, evaluator version, vector-set revision, policy revision, and UTC evaluation time. Authored inputs use Authored provenance with null source revision and commit. Git inputs use Git provenance with the source revision and resolved 40- or 64-character lowercase commit SHA.

Scan accepts one project charter or Skill input. ScanSet accepts inputs from one Skill revision and returns one report per input. It enforces the 64-resource, 1 MiB aggregate resource, and 2 MiB aggregate scan-set limits. Project charters keep the 20,000-character owner limit and a 60,000-byte scan limit. Skill Markdown is limited to 512 KiB, skill instructions to 256 KiB, and each resource to 256 KiB.

Invalid UTF-8 and inputs above their owner limit fail before evaluation. A completed report contains the evaluator score, grade, covered and total vector counts, the recommended-threshold result, and missing vector IDs with OWASP categories. The .NET evaluator has 12 vectors; the recommended threshold is a score of 70. EvaluatorError reports a fixed error code for a regex timeout, input-hash mismatch, or unsupported vector set, without source text or match details. The score measures defensive-language coverage. It is not a finding that content is safe or unsafe.

The pinned Python evaluator at AGT commit 48f04e5ad1efd4f2e5692d4b67def2e0f99a6870 remains separate. It has 17 vectors and a 100,000-character input limit; its output is not part of the .NET report.

Optional charter scan on configuration save ​

PUT /api/v1/projects/{projectId}/configuration (and the Projects owner PUT /api/projects/{projectId}/configuration) accepts an optional nullable scanCharterAgentId. Omitting the field or sending null skips the scan and omits charterScan from the response. GET configuration responses and other configuration update routes remain unchanged.

After authorization, project lifecycle, expected-revision, and configuration validation checks pass, the owner requires an exact ordinal match in configuration.agentCharters. Blank or unmatched selectors return 400 invalid_charter_selection without echoing the selector.

After the configuration revision commits, the owner scans the selected charter from the exact serialized JSON of that committed revision, encoded as strict UTF-8 without a byte-order mark or normalization. The source uses ProjectConfiguration, the committed revision, Authored provenance, and the logical path agent-charters/by-id-sha256/<lowercase SHA-256 of agentId>/charter.

  • When the scan completes with PromptContentScanStatus.Completed, the response includes charterScan with agentId, status: "completed", and report. Low coverage scores still return completed.
  • When post-commit decoding, strict UTF-8 encoding, or evaluation fails, or when report.Status is not Completed, the save remains committed and the response includes charterScan with agentId, status: "unavailable", and code: "charter_scan_unavailable", with no report, digest, findings, or charter text.

Skill trust evidence ​

The internal Projects & Config trust-evidence service scans one stored, non-revoked Skill revision. It copies source metadata as stored and reports Authored provenance; those fields do not verify Git origin. The idempotency fingerprint binds the project, actor, key, content digest, stored source fields, and complete scan report except EvaluatedAt. An exact retry returns the saved report set. Reusing the key with a changed report returns 409. A new report set appends a pending skill.trust.evidence.v1 governance decision. This service has no HTTP route and does not decide assignment or runtime admission.

Project Skill scan admission ​

The owner builds scan inputs from canonical Markdown reconstructed from the validated Skill name, description, and instructions, plus each resource's exact bytes. It scans every project Skill candidate, including generic preview and package requests. Caller-supplied reports and source labels never grant admission. Existing bundled Skills remain outside the project content routes.

The owner requires a current, complete, passing report set before it returns a preview or package result, imports a revision, enables an assignment, saves configuration with enabled imported Skills, accepts a run that uses them, or returns accepted-run content. The owner scans stored content again at assignment and runtime delivery. A completed report below the recommended threshold returns 422 with skill_scan_blocked. Missing, stale, malformed, or evaluator-error reports return 503 with skill_scan_unavailable.