Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.48.0.
Run breg-mcp and breg-review beside your Base Registry Engine (BReg) so a citizen can ask a
chat host, for example an AI assistant, to read their own Record and prepare a change to it. The
citizen then submits that change on a review page you host. You need a registry project with a
proposal-mode Action, an issuer that exchanges tokens and carries task grants, and a TLS proxy.
What the two services do
Section titled “What the two services do”breg-mcp is a Model Context Protocol (MCP) gateway. A chat host calls it at /mcp with a token
issued for one signed-in citizen. The gateway reads that citizen’s Record and starts or edits a
Proposal draft, which its tools call an application. breg-review is a server-rendered page where
the citizen signs in, compares the draft with their Record, and submits it.
The gateway advertises MCP revision 2026-07-28 and serves Streamable HTTP with tools/list, tools/call, and protected-resource metadata.
It advertises tools only: no resources, prompts, sampling, or model-host administration.
Its tested surface is not a compatibility certification for every chat host or every protocol revision the SDK recognises.
Neither service adds registry semantics: BReg decides what the citizen may see or change, under the access profile each service names. The two run with separate credentials, so no process can both prepare a change and submit it.
Both services ship in releases as an experimental surface: they stay outside the compatibility promise and may change in any minor release. Neither provides the task authority that issues the citizen’s grants, so your deployment integrates its own (see An issuer and a task authority).
| Tool | What it does |
|---|---|
describe_service | Returns the configured name, description, and disclosure |
get_my_details | Returns the citizen’s own Record |
start_application | Starts a draft, keyed by a startAttemptId UUID |
list_applications | Lists the citizen’s applications, a page at a time |
update_application | Edits a draft at an expectedRevision, with 1 to 64 patch operations |
prepare_review | Returns the draft and its reviewUrl |
get_application_status | Returns the application’s status |
Each input schema offers only the fields the gateway’s access profile may write, and never the target input. Registry text comes back labelled as data, never as instructions.
A chat host that reaches past that split gets these results:
| The chat host tries to | Result |
|---|---|
| Pass the target input, or a field it may not write | invalid-arguments, before any call to BReg |
| Start when BReg returns no single Record for the citizen | record-not-resolved; nothing is created |
| Reach an application the citizen does not own, or whose target is no longer theirs | not-found |
Edit with an outdated expectedRevision | stale-application |
| Edit after submission | application-not-editable |
| Submit, cancel, or apply | No tool exists, and the gateway’s profile holds no such operation |
status reads draft until the citizen submits, then submitted, then applied, rejected, or
cancelled as the Action’s review and application settings decide.
The review page re-reads the draft and its target under the citizen’s token before it shows the form and at submit. An unreadable target gets the same 404 as a missing draft, and a changed draft is shown again with a notice.
What you need
Section titled “What you need”A registry project
Section titled “A registry project”Declare a Record type with an owner field the citizen cannot write, a proposal-mode Action whose reference input targets it, and two access profiles. Actions and Proposals shows the Action. The gateway’s agent profile carries a task grant:
accessProfiles: citizen-agent: principalClaim: sub actorKind: agent requesterClients: [<gateway-exchange-client-id>] requiredScopes: [address-correction:self] requiredPurposes: [address-correction] taskGrant: sourceIssuer: https://tasks.example.com permissions: records: - recordType: person-address operations: [get, list] readableFields: [address-line, locality, postal-code] rowBoundaries: - field: owner claim: sub operator: equals actions: - action: correct-address operations: [start] targets: - recordType: person-address rowBoundaries: - field: owner claim: sub operator: equals proposals: - action: correct-address operations: [get, list, edit] ownership: caller readableInputs: [address, new-address-line, new-locality, new-postal-code] targets: - recordType: person-address rowBoundaries: - field: owner claim: sub operator: equalsThe citizen gateway needs Proposal Get to prepare a review and report status, so its profile
uses taskGrant. A task-grant profile must name requesterClients and requiredPurposes,
and may not write Records directly. A standing agent without a task grant can Start and edit
its own draft. An institution may separately grant get-review-context, including for a
submitted Proposal, to an exact requester client with a verified trusted actor. That agent
profile defines source disclosure; it does not inherit the represented person’s BReg
permissions. Other submitted lifecycle operations remain refused with
breg.proposal.standing-agent-operation-forbidden. Keep review-context disclosure disabled
until the institution approves its reviewer population and field/row ceiling.
The review page’s profile, citizen-review here, uses actorKind: human, its own client, and no
task grant. It adds submit and cancel on the Proposal.
Control access and reads explains each permission.
The registry runtime
Section titled “The registry runtime”In BReg’s runtime configuration, admit both clients, trust the gateway as an actor, and name the task authority:
authentication: oidc: audience: https://registry.example.com/citizen-address-correction allowedClients: - <gateway-exchange-client-id> - <review-page-client-id> authorityClaims: principal: sub purpose: registry_purpose trustedActors: <gateway-exchange-client-id>: <gateway-actor-subject>taskGrantStatus: - sourceIssuer: https://tasks.example.com baseUrl: https://tasks.example.com tokenEndpoint: https://login.example.com/token clientAssertionAudience: https://login.example.com clientId: <registry-status-client-id> privateKeyRef: secret:file/task-status-key statusResource: <task-authority-resource>BReg accepts a delegated token only when its act claim names the subject trustedActors maps to
the gateway’s exchange client. Before every Proposal read and change, BReg asks the
taskGrantStatus authority whether the grant is still current.
What a token must carry gives the rest of the token
contract.
An issuer and a task authority
Section titled “An issuer and a task authority”Neither service serves an authorization endpoint. Register each chat host, the gateway’s exchange client, and the review page’s client with your issuer ahead of time, each with its own key.
The chat host’s token is an RFC 9068 at+jwt whose audience is exactly the gateway’s
resourceServer.resource.
For the gateway, the issuer must support:
private_key_jwtauthentication for the exchange client, with the issuer as assertion audience.- A
client_credentialsgrant that honours the RFC 8707resourceparameter, so the actor token is issued for the gateway and never for BReg. - RFC 8693 exchange of the chat host’s token. The issued token names the citizen in
sub, carries BReg’s audience, and has anactclaim of exactlysub, orsubandiss.
Each exchanged token also carries the task grant: registry_grant_id,
registry_grant_source_issuer, registry_grant_client, registry_grant_resource,
registry_grant_exp, registry_grant_bounds, registry_approver, registry_purpose,
registry_actor_kind set to agent, and an identity object of 1 to 32 members. The bounds cover
the agent profile’s Record and Action permissions, plus one entry for each Proposal:
{ "type": "breg", "permissions": [ { "collection": "person-addresses", "operations": ["get", "list"] }, { "collection": "action:correct-address", "operations": ["start"] }, { "collection": "proposal:<proposal-id>", "operations": ["get", "list", "edit"] } ]}Whoever issues grants must therefore learn each Proposal the gateway starts and name it in that
citizen’s later grants; a Start grant gives no later Get, List, or Edit access. Neither service
provides this task authority or provisions those grants, and token exchange alone creates no
per-Proposal authority. The task authority answers BReg’s status request at
/v1/task-grants/{grantId}/status, unless statusPath names another route.
For the review page, the issuer must offer OpenID Connect discovery, the code flow with PKCE (S256),
private_key_jwt with the issuer as assertion audience, and the RFC 8707 resource parameter. ID
tokens are signed with EdDSA, ES256, ES384, RS256, or PS256. The registry token carries
registry_actor_kind set to human.
Configure the gateway
Section titled “Configure the gateway”breg-mcp reads one closed YAML document at the absolute --runtime-config path. It refuses
unknown and duplicate keys, and names the replacement for a renamed one. String values accept
${VAR}, ${VAR:-default}, and ${VAR:?message}; secret references never do.
apiVersion: id.registrystack.org/formats/breg/mcp-runtime/v1alpha1kind: BRegMcpRuntimeConfiglistener: bind: 10.0.0.10:8110 tlsTermination: operator-controlled-upstream networkExposure: private-addresssecretProviders: file: root: /run/secrets/breg-mcpresourceServer: resource: https://assistant.example.com/mcp issuer: https://login.example.com jwksSource: type: uri uri: https://login.example.com/jwks.json algorithms: - ES256 allowedClients: - <chat-host-client-id> requiredScopes: - address-correction:selfregistry: baseUrl: https://registry.example.com/ accessProfile: citizen-agent audience: https://registry.example.com/citizen-address-correction scopes: - address-correction:selfexchange: tokenEndpoint: https://login.example.com/token clientId: <gateway-exchange-client-id> privateKeyRef: secret:file/gateway-key assertionAudience: https://login.example.comservice: name: Address correction description: Correct the postal address the registry holds for you. disclosure: The assistant you use will see your current address and the correction you request. details: recordType: person-address application: action: correct-address targetInput: address reviewBaseUrl: https://review.example.com/audit: destination: file path: /var/lib/breg-mcp/audit/audit.jsonl hashKeyRef: secret:file/audit-keyrateLimits: perCitizen: requestsPerMinute: 30 burst: 10 perClient: requestsPerMinute: 600 burst: 100The table below gives each key. Rules that span keys or services:
registry.audienceis BReg’s audience and must differ fromresourceServer.resource, orcheckreportsbreg.mcp-runtime.audience-reused.exchange.clientIdis the client BReg’strustedActorsnames. Listing it inresourceServer.allowedClientsis refused withbreg.mcp-runtime.exchange-client-admitted-inbound.registry.accessProfilenames the task-grant agent profile.service.application.targetInputtakes the input’s identifier, not its API name.service.reviewBaseUrlis the review page’spublicOrigin. Review links take the form<reviewBaseUrl>/proposals/<applicationId>.- Plain
httpURLs are accepted only on a loopback host undertlsTermination: development-loopback. - A fetched key set may not sit at a loopback, private, or cloud-metadata address. Use
jwksSource.type: staticfor an issuer on a private network.
| Key path | Type | Required | Accepted values | Constraints |
|---|---|---|---|---|
apiVersion | string | Yes |
| None specified |
auditThe audit block every Registry Stack product shares: the hash key, then a
file (the default) or stdout destination, with rotation and retention
for a file. | object | Yes | Not specified | None specified |
audit.destinationWhere audit lines go: file or stdout. | string | No |
"file" | None specified |
audit.hashKeyRefSecret reference to the audit hash key. | string | Yes | Not specified |
|
audit.pathThe absolute path of the active audit file. Required for a file
destination, and refused with stdout. | string | Conditional | Not specified |
|
audit.retentionDaysDays a rotated file is kept, for a file destination. Default: 90. | integer | No | Not specified |
|
audit.rotateBytesSize at which the active file rotates, in bytes, for a file
destination. Default: 100 MiB. | integer | No | Not specified |
|
exchangeThe gateway's own client identity at the authorization server. | object | Yes | Not specified | None specified |
exchange.assertionAudienceThe authorization server's issuer identifier, exactly as its metadata
publishes it: the client assertion's sole audience. It has no default. | string | Yes | Not specified |
|
exchange.clientIdThe gateway's client identifier at the authorization server. It may
not also be one of resourceServer.allowedClients. | string | Yes | Not specified |
|
exchange.privateKeyRefSecret reference to the private JWK the gateway signs its client
assertions with, under a declared provider. | string | Yes | Not specified |
|
exchange.tokenEndpointThe authorization server's token endpoint. An https URL with no query
or fragment; plain http is accepted only on a loopback host under
development-loopback. | string | Yes | Not specified |
|
kind | string | Yes |
| None specified |
limits | object | No | Not specified | None specified |
limits.maximumRequestBytesLargest request body the MCP endpoint reads, in bytes. | integer | No | Not specifiedSchema default, where declared: 65536 |
|
listenerThe listener of a runtime that declares its TLS termination and network
exposure. | object | Yes | Not specified | None specified |
listener.bindSocket address the runtime listens on, written host:port with an IP address host ([addr]:port for IPv6). | string | Yes | Not specified |
|
listener.networkExposureThe operator-declared private network placement of an HTTP listener. | string | No |
"private-address" | None specified |
listener.tlsTerminationDeclares the trusted transport boundary for a runtime's plaintext HTTP
listener. Production listeners require operator-controlled upstream TLS
termination; direct plaintext is limited to the explicit loopback-only
development mode. | string | Yes |
| None specified |
logLevelOperational log level when BREG_MCP_LOG is not set. Defaults to
info; accepted values are error, warn, and info. | string | No |
"info" | None specified |
rateLimits | object | Yes | Not specified | None specified |
rateLimits.perCitizenThe limit each citizen's requests share. | object | Yes | Not specified | None specified |
rateLimits.perCitizen.burstRequests admitted at once before the average applies. | integer | Yes | Not specified |
|
rateLimits.perCitizen.requestsPerMinuteRequests admitted per minute, on average. | integer | Yes | Not specified |
|
rateLimits.perClientThe limit each chat-host client's requests share. | object | Yes | Not specified | None specified |
rateLimits.perClient.burstRequests admitted at once before the average applies. | integer | Yes | Not specified |
|
rateLimits.perClient.requestsPerMinuteRequests admitted per minute, on average. | integer | Yes | Not specified |
|
registryThe one registry deployment and access profile the gateway acts on. | object | Yes | Not specified | None specified |
registry.accessProfileThe standing agent access profile every call names. | string | Yes | Not specified |
|
registry.attemptTimeoutMillisecondsHow long one registry call may take before it is abandoned, in
milliseconds. | integer | No | Not specifiedSchema default, where declared: 10000 |
|
registry.audienceThe registry's token audience, requested as the exchange resource. | string | Yes | Not specified |
|
registry.baseUrlThe registry deployment's base URL. An https URL with no query or
fragment; plain http is accepted only on a loopback host under
development-loopback. | string | Yes | Not specified |
|
registry.scopesThe scopes requested for the delegated registry token. | array | Yes | Not specified |
|
registry.scopes[]Array itemAn RFC 6749 scope token: printable ASCII other than space, ", and \. | string | No | Not specified |
|
resourceServerWho may call the gateway: the chat hosts' authorization server. | object | Yes | Not specified | None specified |
resourceServer.algorithmsThe asymmetric signature algorithms an accepted token may use. | array | Yes | Not specified |
|
resourceServer.algorithms[]Array itemAn asymmetric access-token signature algorithm. | string | No |
| None specified |
resourceServer.allowInsecureHttpPermit plain HTTP beyond loopback to the declared issuer and to a JWKS
URI declared in jwksSource. | boolean | No | Not specifiedSchema default, where declared: false | None specified |
resourceServer.allowedClientsThe chat-host clients whose tokens the gateway accepts. | array | Yes | Not specified |
|
resourceServer.allowedClients[]Array itemAn identifier another system issues, written exactly as its issuer gives it. | string | No | Not specified |
|
resourceServer.issuerThe exact issuer accepted in access-token iss claims. An https URL
with no query or fragment; plain http is accepted only on a loopback
host under development-loopback. | string | Yes | Not specified |
|
resourceServer.jwksSourceWhere the issuer's signing keys come from. Omitted, they are read
through the issuer's OpenID Connect discovery document. | object | No | Not specifiedSchema default, where declared: {"type":"discovery"} | None specified |
resourceServer.jwksSource.documentRefAn exact secret reference: secret:file/name, resolved under secretProviders.file.root, or secret:env/NAME, resolved only when secretProviders.environment is declared. | string | Conditional | Not specified |
|
resourceServer.jwksSource.type | string | Yes |
| None specified |
resourceServer.jwksSource.uriAn absolute http or https URL with a host preserved as written, no user information, and no backslash, whitespace or control character. DNS case and equivalent IPv6 literals are permitted. | string | Conditional | Not specified |
|
resourceServer.maximumTokenLifetimeSecondsThe longest lifetime an accepted access token may declare, from its
iat to its exp, in seconds. | integer | No | Not specifiedSchema default, where declared: 3600 |
|
resourceServer.requiredScopesScopes every accepted token must carry. There is no sentinel for
"any scope": a gateway that acts for a citizen always names the
scope that consent was given for. | array | Yes | Not specified |
|
resourceServer.requiredScopes[]Array itemAn RFC 6749 scope token: printable ASCII other than space, ", and \. | string | No | Not specified |
|
resourceServer.resourceThis gateway's resource identifier: the exact URL of its MCP endpoint,
which every accepted token must name as its audience. An https URL
whose path is /mcp, with no query or fragment; plain http is
accepted only on a loopback host under development-loopback. | string | Yes | Not specified |
|
resourceServer.scopeClaimThe access-token claim that carries the granted scopes. | string | No | Not specifiedSchema default, where declared: "scope" |
|
secretProvidersThe secret providers a runtime enables. A reference is resolved only by a
provider declared here: secret:file/name under file.root, and
secret:env/NAME only when environment: {} is present. | object | Yes | Not specified | None specified |
secretProviders.environmentEnables secret:env/NAME references, read from the process
environment. Declared as an empty mapping: environment: {}. | object | Conditional | Not specified | None specified |
secretProviders.fileEnables secret:file/name references, read from files under root. | object | Conditional | Not specified | None specified |
secretProviders.file.rootAbsolute directory holding one file per secret. Each file must be a
regular file owned by the runtime user, mode 0400 or 0600, with exactly
one hard link. | string | Conditional | Not specified |
|
serviceThe authored service a citizen is told about, and the registry entities
its tools work over. | object | Yes | Not specified | None specified |
service.applicationThe proposal-mode Action and its target input, resolved by the gateway. | object | Yes | Not specified | None specified |
service.application.actionA local identifier: a lowercase letter, then up to 63 lowercase letters, digits, _, or -. | string | Yes | Not specified |
|
service.application.targetInputThe input identifier of the input that references the citizen's own
record. | string | Yes | Not specified |
|
service.descriptionText a citizen reads: not blank, at most 4096 characters. | string | Yes | Not specified |
|
service.detailsThe Record type holding the citizen's own record, found through the agent
profile's linked lookup. | object | Yes | Not specified | None specified |
service.details.recordTypeA local identifier: a lowercase letter, then up to 63 lowercase letters, digits, _, or -. | string | Yes | Not specified |
|
service.disclosureWhat the citizen is told about the data the chat host will see. | string | Yes | Not specified |
|
service.nameText a citizen reads: not blank, at most 4096 characters. | string | Yes | Not specified |
|
service.reviewBaseUrlThe citizen-facing review page; an application is reviewed and
submitted there, never through the chat host. The review page's
publicOrigin, with no path, query, or fragment. | string | Yes | Not specified |
|
Configure the review page
Section titled “Configure the review page”breg-review reads its own document under the same rules.
apiVersion: id.registrystack.org/formats/breg/review-runtime/v1alpha1kind: BRegReviewRuntimeConfiglistener: bind: 10.0.0.11:8115 tlsTermination: operator-controlled-upstream networkExposure: private-addresspublicOrigin: https://review.example.comsecretProviders: file: root: /run/secrets/breg-reviewsignIn: issuer: https://login.example.com clientId: <review-page-client-id> clientKeyRef: secret:file/client-key.jwk scopes: - address-correction:selfregistry: baseUrl: https://registry.example.com resource: https://registry.example.com/citizen-address-correction action: correct-address targetInput: address accessProfile: citizen-reviewaudit: destination: file path: /var/lib/breg-review/audit/audit.jsonl hashKeyRef: secret:file/audit-keyRules that span keys or services:
- Register
publicOriginfollowed by/signin/callbackas the client’s redirect URI. - The private JWK that
signIn.clientKeyRefnames must carry akid. The page always requestsopenid, so listing it insignIn.scopesis refused. registry.resourceequals the gateway’sregistry.audience.registry.actionandregistry.targetInputmatch itsservice.application, andregistry.accessProfilenames the human profile.- The issuer must be reachable at a public address.
session.maximumPendingSignInsmust hold every sign-in thatrateLimits.globalSignInadmits withinsession.signInLifetimeSeconds.- One citizen holds at most three sessions, and a fourth sign-in ends the oldest.
development-loopbackalso drops theSecureattribute and the__Host-prefix from the session cookie.
| Key path | Type | Required | Accepted values | Constraints |
|---|---|---|---|---|
apiVersion | string | Yes |
| None specified |
auditThe audit block every Registry Stack product shares: the hash key, then a
file (the default) or stdout destination, with rotation and retention
for a file. | object | Yes | Not specified | None specified |
audit.destinationWhere audit lines go: file or stdout. | string | No |
"file" | None specified |
audit.hashKeyRefSecret reference to the audit hash key. | string | Yes | Not specified |
|
audit.pathThe absolute path of the active audit file. Required for a file
destination, and refused with stdout. | string | Conditional | Not specified |
|
audit.retentionDaysDays a rotated file is kept, for a file destination. Default: 90. | integer | No | Not specified |
|
audit.rotateBytesSize at which the active file rotates, in bytes, for a file
destination. Default: 100 MiB. | integer | No | Not specified |
|
kind | string | Yes |
| None specified |
listenerThe listener of a runtime that declares its TLS termination and network
exposure. | object | Yes | Not specified | None specified |
listener.bindSocket address the runtime listens on, written host:port with an IP address host ([addr]:port for IPv6). | string | Yes | Not specified |
|
listener.networkExposureThe operator-declared private network placement of an HTTP listener. | string | No |
"private-address" | None specified |
listener.tlsTerminationDeclares the trusted transport boundary for a runtime's plaintext HTTP
listener. Production listeners require operator-controlled upstream TLS
termination; direct plaintext is limited to the explicit loopback-only
development mode. | string | Yes |
| None specified |
logLevelOperational log level when BREG_REVIEW_LOG is not set. Defaults to
info; accepted values are error, warn, and info. | string | No |
"info" | None specified |
publicOriginThe browser-facing origin, such as https://review.example: an https
URL with no path, query, or fragment; plain http is accepted only on
a loopback host under development-loopback. The sign-in redirect
URI is this origin with /signin/callback. | string | Yes | Not specified |
|
rateLimitsThe page's own request limits. It reads neither peer addresses nor
forwarded headers, so it cannot tell one browser from another before
sign-in: a per-client limit belongs at the edge proxy. | object | No | Not specified | None specified |
rateLimits.globalSignInOne limit shared by everyone on the unauthenticated sign-in routes,
/signin and /signin/callback. Default: 600 a minute, burst 120. | object | No | Not specified | None specified |
rateLimits.globalSignIn.burstRequests admitted at once before the average applies. | integer | Yes | Not specified |
|
rateLimits.globalSignIn.requestsPerMinuteRequests admitted per minute, on average. | integer | Yes | Not specified |
|
rateLimits.perCitizenOne limit for each signed-in person, shared by all their sessions,
on every request that presents a session. Default: 120 a minute,
burst 30. | object | No | Not specified | None specified |
rateLimits.perCitizen.burstRequests admitted at once before the average applies. | integer | Yes | Not specified |
|
rateLimits.perCitizen.requestsPerMinuteRequests admitted per minute, on average. | integer | Yes | Not specified |
|
registryThe Base Registry Engine deployment and the one access profile the page
reads and submits through. | object | Yes | Not specified | None specified |
registry.accessProfileThe registry access profile every read and submit names. | string | Yes | Not specified |
|
registry.actionThe proposal-mode Action identifier. | string | Yes | Not specified |
|
registry.baseUrlThe registry deployment's base URL. An https URL with no query or
fragment; plain http is accepted only on a loopback host under
development-loopback. | string | Yes | Not specified |
|
registry.resourceThe RFC 8707 resource indicator the person's access token names. | string | Yes | Not specified |
|
registry.targetInputThe reference input naming the record the Proposal changes. The page
reads that record under the person's own token before it offers the
submit form, because the registry does not tie a request's target to
its requester. | string | Yes | Not specified |
|
secretProvidersThe secret providers a runtime enables. A reference is resolved only by a
provider declared here: secret:file/name under file.root, and
secret:env/NAME only when environment: {} is present. | object | Yes | Not specified | None specified |
secretProviders.environmentEnables secret:env/NAME references, read from the process
environment. Declared as an empty mapping: environment: {}. | object | Conditional | Not specified | None specified |
secretProviders.fileEnables secret:file/name references, read from files under root. | object | Conditional | Not specified | None specified |
secretProviders.file.rootAbsolute directory holding one file per secret. Each file must be a
regular file owned by the runtime user, mode 0400 or 0600, with exactly
one hard link. | string | Conditional | Not specified |
|
session | object | No | Not specified | None specified |
session.maximumLifetimeSecondsThe longest a session lasts. A session also ends when the access
token it holds expires, whichever comes first. Default: 3600. | integer | No | Not specifiedSchema default, where declared: 3600 |
|
session.maximumPendingSignInsThe most sign-ins in progress the page holds at once. It must hold
every sign-in rateLimits.globalSignIn admits within
signInLifetimeSeconds. Default: 10000. | integer | No | Not specifiedSchema default, where declared: 10000 |
|
session.maximumSessionsThe most signed-in sessions the page holds at once. Default: 10000. | integer | No | Not specifiedSchema default, where declared: 10000 |
|
session.signInLifetimeSecondsHow long a started sign-in may take to return from the provider.
Default: 600. | integer | No | Not specifiedSchema default, where declared: 600 |
|
signInThe OpenID Provider the page signs people in with, and the confidential
client it authenticates as. | object | Yes | Not specified | None specified |
signIn.clientIdThe page's client identifier at the provider. | string | Yes | Not specified |
|
signIn.clientKeyRefSecret reference to the client's private JWK, used for
private_key_jwt client authentication, under a declared provider. | string | Yes | Not specified |
|
signIn.issuerThe provider's issuer. An https URL with no query or fragment; plain
http is accepted only on a loopback host under development-loopback,
because the page sends its client credentials to the token endpoint. | string | Yes | Not specified |
|
signIn.scopesScopes requested beside openid, such as the review scope the
registry profile requires. The page always requests openid, so the
list does not name it. | array | Yes | Not specified |
|
signIn.scopes[]Array itemAn RFC 6749 scope token: printable ASCII other than space, ", and \. | string | No | Not specified |
|
Run and check
Section titled “Run and check”Check each document with the binary you will serve, then start both:
breg-mcp --runtime-config /etc/breg-mcp/runtime.yaml checkbreg-review --runtime-config /etc/breg-review/runtime.yaml checkbreg-mcp --runtime-config /etc/breg-mcp/runtime.yaml servebreg-review --runtime-config /etc/breg-review/runtime.yaml servecheck reads the file offline: no secret, no socket, no audit file. It exits 0 when the file is
accepted, 1 when something is refused, 2 on a usage error, and 3 when the file cannot be read.
--format json prints one report, --deny-warnings makes a warning exit 1, and --environment
substitutes ${NAME} expressions first.
serve then refuses an unsafe or missing secret, or an unwritable audit directory, before it
binds. Only the first real call proves the issuer and BReg accept the configuration.
Put a proxy in front
Section titled “Put a proxy in front”Neither service terminates TLS. Your proxy forwards plain HTTP to the private listeners, and:
- Serves the review page at exactly
publicOrigin. - Keeps the gateway’s
Host, or rewrites it to the authority ofresourceServer.resource. Any otherHostgets 403. - Never adds an
Originheader, which the gateway refuses before it verifies the token, and passesAuthorizationunchanged. - Rate limits by client address, more tightly on
/signinand/signin/callback. The review page reads no peer address, so itsrateLimits.globalSignInis shared by everyone.
GET /health answers 200 {"status":"alive"}. GET /ready answers 200 {"status":"ready"}
while the audit journal is writable, and 503 {"status":"not-ready"} otherwise. Neither probe
calls BReg or the issuer.
Install or run the images
Section titled “Install or run the images”Each release publishes both services as linux-amd64 binaries, verified as
Obtain the runtime describes, and as images under
ghcr.io/registrystack/. Deploy both from one tag, and images by digest.
Each image runs as the Distroless nonroot user and reads /etc/<service>/runtime.yaml. Mount
configuration and secrets read-only, and a volume at /var/lib/<service> for the journal. Bind
0.0.0.0 with networkExposure: container-private. The image has no shell, so probe it from your
platform.
Operate
Section titled “Operate”Handle secrets
Section titled “Handle secrets”Every credential is a reference. secret:file/<name> reads a file under
secretProviders.file.root, and secret:env/<NAME> reads a variable once
secretProviders.environment is declared. Secret files follow the ownership and mode rules in
Create the secret files. Each service needs its own
private JSON Web Key (JWK) and an audit key of at least 32 bytes.
Secrets are read at startup. To rotate a client key, register the new public key beside the old
one, replace the file, restart, and then retire the old key. A fetched issuer key set picks up a new
key by itself; with jwksSource.type: static, add it and restart before the issuer uses it.
Keep the audit key stable, because it keys the pseudonyms and the gateway’s retry identity. To
change it, restart with no retry outstanding and write to a fresh audit.path.
Keep the audit journal
Section titled “Keep the audit journal”Each service writes its own journal through the
shared audit writer, which
owns rotation, retention, and fail-closed behaviour. BReg audits the delegated calls separately.
Give each process its own audit.path on durable storage, and ship sealed files before
audit.retentionDays removes them.
Each gateway tool call ends with an outcome: ok, refused with no registry effect, or
unfinished when a sent start or edit has an unknown effect. Citizens and clients appear only as
keyed pseudonyms. No field value, tool argument, token, or cookie is written. When the journal
refuses an entry, the gateway answers service-unavailable and the review page audit-unavailable.
Read the logs
Section titled “Read the logs”Both services write JSON lines on standard output. BREG_MCP_LOG or BREG_REVIEW_LOG sets the
level to error, warn, or info, the default; any other value exits 2. A refused configuration
exits 1 on standard error. Later startup failures go to standard output from breg-mcp and to
standard error from breg-review, so collect both.
| Service | Level | Message |
|---|---|---|
breg-mcp | info | tool call, with request_id, tool, and outcome |
breg-mcp | warn | the access-token key set is unavailable |
breg-mcp | error | tool audit request refused or tool audit response refused |
breg-review | warn | a rate limit refused a request |
breg-review | warn | the registry declined a review request or the registry could not answer a review |
breg-review | error | Any message ending could not be audited |
Neither service logs a token, secret, cookie, or field value.
Upgrade
Section titled “Upgrade”Run the new binary’s check before you replace the old one. Both services finish requests in
flight on SIGTERM or SIGINT. The gateway keeps no state, but the review page holds sessions in
memory, so a restart signs every citizen out. Run one review page instance, or pin each browser to
one, because every limit counts per instance. After a registry package changes the Action, the
review page answers older drafts with 409 action-changed.
Tool errors
Section titled “Tool errors”A failed tool call answers {"error":{"code":"<code>","message":"<text>"}}, with a traceId when
BReg supplied one. Each code has one fixed message:
| Code | Cause |
|---|---|
invalid-arguments | The arguments do not fit the tool |
record-not-resolved | BReg returned no single Record for the citizen |
not-found | No such application for this citizen |
application-not-editable | The application is no longer a draft |
stale-application | The gateway compared revisions and found the application or its Action definition changed |
change-refused | BReg refused a required condition, a current-state conflict, or an expired idempotency receipt |
idempotency-conflict | An earlier request with the same key is running or differed |
not-permitted | The Action refused the request |
authorization-failed | A credential is missing, unusable, or no longer accepted; signing in again resolves it |
authorization-refused | The issuer refused delegated access or granted too few scopes; signing in again alone may not resolve it |
registry-unavailable | BReg, the issuer, or the task authority did not answer |
service-unavailable | The gateway cannot record or run the call |
unexpected-response | BReg answered in a form the gateway cannot use |
change-refused establishes neither a stale revision nor a withdrawn grant. BReg answers a
withdrawn grant with the same value-free 412 as any other failed condition, so the gateway
cannot tell the two apart and never reports a withdrawn grant as stale-application.
Generate one startAttemptId for each application the citizen intends, and reuse it on every
retry, including after an uncertain answer. The same ID replays the original Start, and a new ID
opens another application even with identical input. The task authority must reissue the original
grant for the retry, because a new or widened grant cannot replay the earlier Start.
A request refused before any tool runs gets an RFC 9457 problem:
| Status | code |
|---|---|
| 401 | unauthorized or invalid-token, with a WWW-Authenticate challenge |
| 403 | insufficient-scope, or forbidden for a wrong Host or any Origin header |
| 404 | not-found |
| 429 | rate-limited, with Retry-After |
| 503 | temporarily-unavailable |
What the design guarantees
Section titled “What the design guarantees”Whatever the chat host does:
- The gateway never submits, cancels, or applies a Proposal, or writes a Record. Its lint configuration disallows those client methods, and a boundary check proves it.
- BReg holds the same line: the gateway’s task-grant profile cannot write Records and stays within the grant.
- The target comes from the citizen’s own Record. BReg checks the
targetsrow boundaries on every Start, edit, and submit, and takes ownership from the verified caller. - The chat host’s token is never forwarded, and no delegated token outlives the citizen’s own.
- BReg checks the grant’s status before every Proposal read and change.
- The review page re-reads the target under the citizen’s own token before it submits.
- BReg keeps the Proposal state and the application evidence. Neither the gateway nor the review page keeps a parallel workflow, and where the Action requires review, external policy decides it. BReg then applies the exact frozen Plan, automatically by default under its restricted system grant or manually when you configure that. See Actions and Proposals.
- Neither service retries a mutation on its own. After an uncertain submit the citizen retries from the retained view under the same key, and a later read does not settle an uncertain command or follow a successor submission.
- Boundaries, linked reads, target scope, and Proposal permissions belong in the registry project, not in the gateway or review page configuration.
The configurable, source-built registry-mcp service can bind this same citizen provider, or a
separate Casework delegated staff reader. Keep breg-mcp for existing citizen deployments. Config
checks validate documents offline; a passing check does not prove an issuer exchange or a registry
grant.
Before you operate registry-mcp, plan for what it does not provide:
- It is built from source only. No numbered release asset, installer,
rstackcomponent, or container image ships it, so build it from the exact source revision you operate.breg-mcpremains the maintained citizen deployment. - Citizen and staff access need separate configurations, each with its own resource, admitted clients, scopes, and credentials. The config check refuses one configuration that binds both the BReg citizen provider and the Casework staff reader, and the service never forwards the caller’s inbound token as a provider credential.
- The Adapter binding is experimental. It needs a compatible Adapter that exports an executable
effective contract (
adapter effective-contract), and it runs only the configured operations that contract serves as GET or as explicitly read-only POST. The config check refuses a configured write. dataClass: non-personalis your own unchecked attestation. It is not a data classifier, a grant to read personal data, or a substitute for source authorization. Person-level access and external effects are outside what the binding supports.- The Adapter binding reads one machine token from the secret reference you supply, once at startup. Nothing renews it: before it expires, replace the referenced token and restart the service. Do not lengthen the token’s lifetime as a workaround.
Cookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.