Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.48.0.
Give subjects a log of reads of their Record
A Record type can opt in to a subject-facing log of reads of its Records. The log answers who accessed one subject’s Record, when, and for which declared purpose. It also keeps each direct write made under a profile that must state its reason, with that reason. Base Registry Engine (BReg) stores it apart from its operational audit, which keeps its existing redaction and retention rules. Exemptions add the bounded policy events described later on this page.
The log is registry-local and keyed to the Record that was read. BReg does not create a global subject pseudonym, share a subject key with another registry, or make the log searchable across registries. There is no backfill for reads that happened before a package enabling the log became active.
The log’s storage is installed by every apply, whether or not the package declares accessLog, and
it is part of the catalog BReg verifies before it serves.
BReg refuses to start against a database without the storage.
Declare the policy
Section titled “Declare the policy”Add accessLog to each Record type whose reads must be visible to its subjects:
recordTypes: person: primaryDataset: people route: people mutationMode: mutable classification: restricted fields: - id: citizen-id type: string minimumLength: 1 maximumLength: 128 required: true classification: restricted - id: display-name type: string maximumLength: 200 required: true classification: restricted accessLog: subjectField: citizen-id retentionDays: 90 trustedIntermediaries: - evidence-service exemptions: investigator: reason: active-investigation delayDays: 30subjectField names the field BReg compares with the subject’s verified principal when the subject
retrieves the log.
It must be a required, plaintext, stored string or text field with a maximumLength of at most
512.
How a subject reads the log
Section titled “How a subject reads the log”A subject uses an authenticated access profile that currently grants get for the Record.
BReg returns the log only when the verified principal selected by that profile’s principalClaim
exactly equals the stored subjectField value.
The access-log route is not a separate grant and does not bypass current Record visibility.
The HTTP route serves only the Record subject, under that current get grant and ownership check.
BReg exposes no separate officer or operator HTTP listing of subject logs.
Database administrators can inspect the underlying rows, which hold the actual requester and
purpose, so scope that database access as sensitive operational access.
Govern backup retention separately from the live subject-log retention.
The subject reads:
GET /v1/records/people/00000000-0000-4000-8000-000000000001/access-log?accessProfile=subject&limit=50The response is a bounded page:
{ "events": [ { "id": "00000000-0000-4000-8000-000000000002", "accessedAt": "2026-09-29T10:00:00Z", "requester": "benefits-agency", "serviceClient": "evidence-service", "purpose": "eligibility-check", "operationId": "lookup", "visibleAfter": "2026-09-29T10:00:00Z", "exemptionReason": null, "accessReason": null, "accessKind": "read" } ], "nextCursor": null}limit accepts 1 through 100 and defaults to 50.
cursor is the opaque event identifier returned as nextCursor; it is always scoped to this Record
and the currently verified subject, and it conveys no authority.
Once retention has removed the referenced history, the cursor yields an empty page and the caller
restarts without it.
Every access profile names a verified caller, so every log entry has one.
What an entry contains
Section titled “What an entry contains”An entry holds the accessing client attribution, access time, operation, and verified purpose,
plus delayed-disclosure metadata when an exemption applies.
accessKind is read for a read and write for a direct write.
purpose is null when the verified token carries no purpose; BReg does not invent one.
On a direct read, requester identifies the verified OAuth client when one is available and
otherwise the verified principal, and serviceClient is null.
On a trusted forwarded read, requester is the original verified requester and serviceClient
identifies the verified intermediary.
The log does not copy Record fields, query values, tokens, or a global subject identifier.
Access-log persistence and the read response are governed product state; they are not reconstructed
from the operational audit.
Record why a record was read or written
Section titled “Record why a record was read or written”An access profile with requireAccessReason: true refuses every request that does not carry a
Registry-Access-Reason header, with 400 request.access_reason_required.
The header is the reason as UTF-8 text, base64url-encoded without padding.
It must be sent once, decode to at most 512 bytes, and be neither blank nor contain a control
character.
BReg stores the decoded text as accessReason on each subject access log entry the request
writes, and returns it with the entry.
It is null when the profile does not require a reason.
The text is caller-asserted, so treat it as a claim and not as verified authority.
A direct write under the profile writes one entry with accessKind: write for each record it
changes: a create, a Patch, a tombstone, and each item of a Batch.
The entry is written in the write’s transaction, so a write that rolls back leaves none.
It names the requester and purpose as a direct read does, has a null serviceClient, and takes the
retention and any exemption delay of the profile.
A write entry raises no read alert.
A write under a profile that does not require a reason writes no entry, and neither does an Action
or a Proposal.
A Record type with accessLog gives each reason a durable home.
A Record type without accessLog still refuses a request that omits the reason, but keeps no entry
of it.
bregctl check refuses requireAccessReason on a profile that holds an operation that does not check
the reason: import, invoke, start, bulk data export (allowDataExport), and the action, proposal, dataset,
external view and projection-refresh permissions
(breg.access-profile.access-reason-operation-unsupported).
Alert on reads
Section titled “Alert on reads”A Record type that declares accessLog can raise an event for each logged read by a named profile.
The event is written with the entry, so bregctl check refuses a read hook on a Record type without
accessLog (breg.disclosure.read-hook-access-log-required).
Declare a hook with trigger: read and the profiles it covers:
hooks: - id: case-read-v1 phase: after trigger: read profiles: - caseworker projection: [] handler: type: url destinationId: security-deskThe event is stored in the same transaction as the access log entry, so a read that is logged
raises its alert, and a failure to store either refuses the read.
Its values is empty and its access member names the profile, operation, requester, purpose,
access reason and the access log event id.
It names the record’s latest retained revision.
See Webhooks.
Set the retention
Section titled “Set the retention”retentionDays defaults to 90 and accepts 1 through 3650.
Each row records its own expiry when the read occurs.
A later package can change the policy for new rows, but it does not extend already-recorded expiry,
remove retained history, or turn disabling accessLog into erasure.
Every minute, the background retention worker erases expired rows in batches of 1000, each committed
on its own, until a batch comes back short, including after a later package disables logging.
One tick stops after 100 batches (100,000 rows) and logs a warning with the remaining expired
backlog; the next tick continues from there.
Expired rows are hidden immediately even when their physical deletion awaits a later tick.
Operator backup retention is separate from the live subject-log retention.
Monitor and recover lists the subject-access-log-retention worker and its
metrics.
Preserve requester attribution through an intermediary
Section titled “Preserve requester attribution through an intermediary”By default, an entry identifies the verified client that called BReg.
A service such as Registry Evidence may need the entry to identify the original requester and
purpose rather than the intermediary alone.
trustedIntermediaries is the closed set of verified OAuth client IDs allowed to supply that
forwarded attribution.
Each value is a nonempty, non-whitespace client identifier of at most 512 UTF-8 bytes, and a Record
type can list at most 64.
BReg accepts forwarded attribution only after authentication, when the selected profile and verified
token identify a client in that set.
The forwarded values travel together in Registry-Access-Requester and Registry-Access-Purpose.
Each header is the canonical base64url encoding without padding of a nonblank UTF-8 value of at
most 512 bytes, with no control characters.
BReg refuses duplicate or incomplete pairs.
This is the same
source attribution contract Evidence uses, and it
grants no Record authority.
An unlisted caller cannot make another client appear in the subject log.
BReg never derives this trust from a request header, issuer name, or Registry Manifest projection.
The BReg Evidence exporter enables forwarding for a Record type with accessLog.
Configure the exported Evidence source connection to authenticate as a client listed in that Record
type’s trustedIntermediaries; BReg refuses the forwarded request when the verified connection
client is absent.
Export a lookup for Evidence covers the connection.
Evidence forwards attribution only for a verified requester and a declared purpose. Other read paths record the direct verified client and the request’s verified purpose. Operational audit continues to record only its existing bounded metadata and does not gain raw purpose or subject values from this feature.
Delay a documented entry
Section titled “Delay a documented entry”Some authorised reads cannot be disclosed immediately.
exemptions maps an existing read-capable access profile to a governed policy reason and delay.
A Record type can declare at most 64 exemptions.
reason must be trimmed printable text of at most 256 UTF-8 bytes.
delayDays must be at least 1 and less than retentionDays.
An exemption without sourceRecordType applies to direct reads authorised by the named profile on
the logged Record type.
A relationship read uses the profile and Record type at the start of its read path, so a delayed
relationship entry names that authority Record type explicitly:
exemptions: relationship-investigator: sourceRecordType: case reason: active-investigation delayDays: 30The compiler accepts this form only when the named profile belongs to sourceRecordType and grants
a declared read path from that Record type to the logged Record type.
BReg matches both the source Record type and the profile when applying the delay, so an unrelated
profile with the same ID cannot inherit the exemption.
An exempt read is still written.
Its row retains the policy reason and an exact visibleAfter time.
The operational audit records that the governed exemption was applied without copying the subject,
purpose, or other access-log values.
That audit entry uses the breg-access-log/v2 schema and includes only a policy-keyed reference,
delay, profile, Record type, and activation binding (activationId).
It does not copy the policy reason.
The subject route withholds the row until visibleAfter; an exemption never silently omits a read.
A package upgrade does not retroactively hide a visible entry, reveal a delayed entry early, or
rewrite its reason.
Reads covered
Section titled “Reads covered”BReg logs each authorised Record materialised from storage through direct get, list (including GIS
collection items), lookup, relationship traversal, snapshot and revision routes, and the root Records
returned by an external view read.
BReg writes no subject-log entry for a Proposal attachment download or a Proposal review read, even
when the review shows fields of a Record type with accessLog.
Those reads are recorded only in BReg’s audit records.
If data subjects must see them, cover them in your own audit.
Paging lookahead rows are removed first, so they do not become events.
A refusal before Record access and a query that matches no Record create no subject-log entry.
An unresolved ambiguous lookup can materialise candidate Records before it refuses the response;
those accesses are recorded.
Each materialised Record gets its own entry, so a list or historical query cannot be represented as
one ambiguous subject event.
The access-log insert occurs before response release, and its failure refuses the read. Once the entry commits, a later serialisation, terminal-audit, or network failure does not erase it. An entry therefore records that BReg accessed and prepared the Record under the caller’s authority, even when the caller did not receive the response bytes.
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.