Registry stack documentation: machine-readable Markdown.
Index of all pages: https://docs.registrystack.org/llms.txt
Full corpus: https://docs.registrystack.org/llms-full.txt

# Registry Adapter security model

> Review the Registry Adapter facade's authority, source access and audit boundaries before admitting a client.

Before admitting a machine client to your Registry Adapter facade, check which records and
operations it can reach through the source connection you configure.

## Caller authority

The facade checks the OIDC bearer token against the issuer's configured audience and
`oidc.issuers.<id>.allowedClients` list. For data operations, a project access profile checks the
token's scopes for the requested operation and record type. An admitted client can reach every record the configured source access
exposes through that operation. The facade has no per-record authorisation or personal delegation.
Review each client's access against the full source reach before adding it to the allowlist.
Use a narrower source credential or a restricted source view when the client needs fewer records.

{/* Evidence: crates/registry-adapter/src/facade.rs, admitted();
    crates/registry-adapter-core/src/runtime.rs, AdapterCallerIssuer, the_allowed_clients_carry_at_least_one_client;
    crates/registry-adapter/src/serve.rs, Authenticator::authenticate;
    crates/registry-adapter/tests/facade_refusals.rs, every_refusal_keeps_its_answer_and_is_counted_and_logged_under_its_check;
    crates/registry-adapter/tests/effective_contract_live.rs, authentication_and_admission_precede_the_pin_which_precedes_body_and_source;
    crates/registry-adapter-engine/src/effective_contract.rs, AuthorityBoundary. */}

The facade, standalone payments, and job hook listeners expose unauthenticated `GET` and `HEAD`
probes on `/health` and `/ready`. See [Probe health and readiness](../../operate/adapter/#probe-health-and-readiness)
for the checks each listener performs.

{/* Evidence: crates/registry-adapter/src/facade.rs, probe_routes;
    crates/registry-adapter/src/payments/http.rs, run_only;
    crates/registry-adapter-job/src/hook_ingress.rs, HookIngressPlan::bind;
    crates/registry-adapter/tests/postgres_journal_retention_served.rs, payments_only_probes_follow_the_payment_store;
    crates/registry-adapter-job/tests/hook_ingress_postgres.rs, hook_listener_probes_follow_the_read_only_job_store_checks. */}

## Source access

The caller's token stays at the facade. Each upstream call uses the endpoint's configured
authentication. An endpoint with no application credential requires numeric loopback, HTTPS with
an mTLS client identity, or a fixed HTTPS source you explicitly acknowledge with
`anonymousHttps: operator-approved`. Use that acknowledgement only after reviewing what the
source exposes without a credential. The facade still checks the caller and verifies the upstream
TLS certificate.

{/* Evidence: crates/registry-adapter-core/src/runtime.rs, record_endpoint_posture, AnonymousHttpsAcknowledgement;
    crates/registry-adapter-core/src/checks.rs, runtime_refuses_none_outside_loopback_without_mtls;
    crates/registry-adapter/tests/camel_http_authentication.rs, none_sends_nothing_and_stays_loopbound;
    crates/registry-adapter/tests/egress_tls_wiring.rs, acknowledged_anonymous_https_sends_no_authentication_header. */}

## Audit and refusal monitoring

The facade's PostgreSQL journal records exchanges with caller and operation metadata and excludes
request and response bodies. A required journal write that fails blocks normal response release.
Monitor journal failures and keep journal access restricted to the identities that operate it.

Review the separate PostgreSQL stores for retained payloads. The
[idempotency store](../../configure/adapter/#response-custody) holds exact write responses for the
configured retention window. The optional [payment store](../../configure/adapter/#typed-payment-hosting)
holds bounded payment facts for recovery.

The facade's private `metricsListener` exposes `adapter_request_refusals_total` for recorded facade
and co-hosted payment refusals. A payment-only deployment emits the rate-limited refusal log and
serves no metrics listener.

The job host serves metrics with `metricsListener` configured while `adapter-job pass --loop` runs.
A build with the `job-hook` feature exposes `adapter_job_request_refusals_total` on that listener.
Configured hook ingress increments it for credential and rate-limit refusals. The separate
`adapter_job_hook_refusals_total` also counts hook refusals such as an oversized body.

{/* Evidence: crates/registry-adapter/src/facade.rs, journal_failure, append_all;
    crates/registry-adapter/tests/postgres_security_boundaries.rs, assert_no_markers;
    crates/registry-mcp/tests/native_adapter.rs, journal_failure_precedes_native_source_disclosure;
    crates/registry-adapter/src/idempotent.rs, finish_with_client, sweep_expired;
    crates/registry-adapter/src/payments/store.rs, Attempt, reserve();
    crates/registry-adapter/src/payments/g2p_store.rs, G2pAttempt, record_observation;
    crates/registry-adapter/src/serve.rs, run_configured, run_facade;
    crates/registry-adapter/src/metrics.rs, adapter_request_refusals_total, record_refusals;
    crates/registry-adapter/src/payments/http.rs, payment_router, run_only;
    crates/registry-adapter/src/payments/http/refusal_tests.rs, every_payment_refusal_keeps_its_answer_and_is_counted_under_its_check;
    crates/registry-adapter-job/Cargo.toml, job-hook;
    crates/registry-adapter-job/src/main.rs, pass(), check_hook_runtime;
    crates/registry-adapter-job/src/metrics.rs, JobMetrics::render, adapter_job_request_refusals_total, adapter_job_hook_refusals_total;
    crates/registry-adapter-job/src/hook_ingress.rs, validate_hook_runtime, refused_hook_requests_are_counted_by_reason,
    each_refused_credential_is_counted_under_its_check_with_an_unchanged_answer. */}

## Next

- [Configure caller and source access](../../configure/adapter/#authorisation-and-secrets)
- [Scrape private metrics](../../operate/adapter/#scrape-metrics)
- [Review the effective operation contract](../../reference/adapter-effective-contract/#authority)