> For the complete documentation index, see [llms.txt](https://docs.openiam.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openiam.com/administration-guide/pbac/privacy-decisions.md).

# Privacy decisions

Make a PBAC policy depend on a person's consent for a privacy purpose, read the privacy record and obligations it works with, and know what the gateway and guarded API methods do with the four-valued

**Applies to:** OpenIAM 2026.11.1

## What this is, and when you need it

A **privacy decision** is an ordinary policy-based access control (PBAC) decision in which a policy on the resource requires consent for a **purpose** registered in the [Privacy module](https://docs.openiam.com/administration-guide/privacy.md). It answers the question that module exists for — *may this request go ahead with this person's data, for this purpose, right now, and under what conditions?* — through the same decision service and the same policies as every other PBAC decision. The gateway or application that asks does not change: it asks whether a user may reach a resource, and the engine works out that consent is involved, whose consent, and for which purpose.

What that sameness costs you is that a consent policy can look entirely correct and still do nothing. The gateway check has to be enabled before any of it applies, the engine picks policies up on a sweep rather than the moment you save, and anybody who has never opened the Privacy Center has no privacy subject, so their decisions answer `REVIEW_REQUIRED` rather than permitting or denying. None of the three shows up in the policy editor, which is why the [decision log](https://docs.openiam.com/administration-guide/pbac/trace-a-decision.md) is the first place to look.

Read this page when you want an application, a URL behind the Access Gateway, or a guarded API to be reachable only while the person has granted consent for a purpose. The purposes, lawful authorities and notices themselves are authored in the Privacy module — see [Register purposes and lawful authorities](https://docs.openiam.com/administration-guide/privacy/register-purposes-and-authorities.md). Sending a browser to a consent page instead of refusing it is [Ask for consent at the gateway](https://docs.openiam.com/administration-guide/privacy/enforce-consent-at-the-gateway.md).

## How a policy requires consent

In the policy builder, the **Privacy** section has a **Requires consent for purpose** list. It offers the `ACTIVE` purposes of the Privacy module's registry; choosing one writes the purpose onto the statement and adds the condition *consent state is GRANTED*, which you can extend in the conditions below it. **No purpose (access policy)** leaves the policy an ordinary access policy. When the registry cannot be reached, or the purpose you need is not `ACTIVE`, the builder offers a **Purpose id** field instead.

In Cedar the purpose is the `@privacy_purpose` annotation, and the consent state is a condition on the `context.privacy` record like any other:

{% code overflow="wrap" expandable="true" %}

```cedar
@privacy_purpose("<PURPOSE_ID>")
@obligation("MASK")
@obligation_params("fields=pan;pattern=LAST_4")
@obligation_mandatory("true")
@obligation2("LOG")
permit (
  principal in Openiam::Role::"<ROLE_ID>",
  action,
  resource == Openiam::Resource::"<RESOURCE_ID>"
)
when {
  context.privacy.consentState == "GRANTED"
};
```

{% endcode %}

Read it as: holders of the role may reach the resource while the person's consent for the purpose is granted, and whoever serves the request must mask the card number and log the access.

One statement names at most one purpose. A policy that needs two purposes uses two statements, each with its own annotation. Statements that name no purpose are **access statements**: they take part in every evaluation and never read the privacy record. Two policies on one resource may therefore require consent for two different purposes, and each reads the consent state of its own.

{% hint style="warning" %}
**Keep `@privacy_purpose` on every statement that reads `context.privacy`.** The record is supplied only to statements that name a purpose. In the builder this cannot go wrong, because it writes the annotation and the condition together; in the Cedar text editor it can. The builder also refuses **Applies unless a group matches** on such a policy: it has to apply *while* consent is granted.
{% endhint %}

**Whose consent.** The **data principal** is the request's principal — the person acting on their own data — found through the identity link the Privacy Center creates on their first visit. A guarded API method that processes somebody else's data names that person instead, as described under [Guarded API methods](#guarded-api-methods).

## Where consent state comes from

The engine has no access to the `privacy` database and keeps no copy of consent state. The Privacy module publishes a small, pre-resolved **enforcement projection** to the shared Redis cache — the identity link, the purpose version with its lawful authority and activities, the consent state and the notice version — and the engine reads it on every decision. The Privacy module writes the projection after the change is committed and before it answers the person who made it, so once a withdrawal has been acknowledged no decision can be served from the earlier state.

When a projection entry is missing or Redis cannot be read, the engine asks the Privacy module to resolve the state from its database, which also rewrites the projection; that decision costs one extra round trip. When the Privacy module does not answer in time either, the purpose's state counts as unavailable and its permits cannot apply.

| Property                                                 | Service           | Default   | What it decides                                                                                                                                      |
| -------------------------------------------------------- | ----------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `org.openiam.privacy.tenant.id`                          | `pbac-manager`    | `default` | The privacy tenant the engine reads consent from — the same deployment-wide tenant the Privacy Center writes to                                      |
| `org.openiam.pbac.privacy.resolve.timeout.ms`            | `pbac-manager`    | `250`     | Longest a decision waits for the Privacy module after a projection miss                                                                              |
| `org.openiam.pbac.privacy.resolve.threads`               | `pbac-manager`    | `16`      | Threads kept for those resolves. When all are busy a further resolve is refused at once, so a Privacy module outage cannot occupy the decision queue |
| `org.openiam.pbac.privacy.no.policy.outcome`             | `pbac-manager`    | `DENY`    | The outcome when a caller declares a purpose and no activated policy applies to the resource                                                         |
| `org.openiam.privacy.enforcement.projection.ttl.seconds` | `privacy-manager` | `86400`   | Lifetime of each projection entry. Zero or less keeps entries until they are overwritten                                                             |

These are service properties, not **System Properties** entries: the deployment owner sets them and restarts the service — see the [Installation and Tuning Guide](https://docs.openiam.com/installation/settings.md).

## The rules the engine applies before any policy

For each purpose it evaluates, the engine first applies the Privacy module's own rules, in this order. No policy can relax them.

| Check                                                                                                              | When it fails                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
| The purpose is a known, `ACTIVE` purpose version of the tenant                                                     | `DENY`                                                                                                         |
| An activity the caller declared is actively associated with the purpose                                            | `DENY`                                                                                                         |
| The data principal is a known privacy subject                                                                      | `REVIEW_REQUIRED`, missing context `subject`                                                                   |
| The purpose has a lawful authority                                                                                 | `REVIEW_REQUIRED`, missing context `lawfulAuthority`                                                           |
| The lawful authority is `ACTIVE` and inside its validity window                                                    | `REVIEW_REQUIRED`                                                                                              |
| **Consent-based authority only:** consent is recorded                                                              | `DENY` — `No consent recorded for this purpose; consent-based processing fails closed`                         |
| **Consent-based authority only:** the consent state is `GRANTED`                                                   | `DENY` — `Consent state is WITHDRAWN; processing must stop (CON-006)`, and the same for `DENIED` and `EXPIRED` |
| **Consent-based authority only:** the notice the consent was given on has not been superseded by a material change | The notice's material-change behavior decides: `BLOCK` is `DENY`, `RE_PROMPT` is `REVIEW_REQUIRED`             |

A purpose whose lawful authority is **not** consent-based — a legal obligation, say — skips the three consent checks: the policies decide, and may still attach obligations.

What a failed check does depends on who named the purpose. For a purpose a **policy** names, the failure suspends that purpose's permits — they cannot permit what the rules forbid — while its forbids and every access statement still apply. A role policy that grants the same resource without any purpose therefore still grants it. When nothing else permits, the answer carries the failed check's reason, so a person who must re-confirm consent gets `REVIEW_REQUIRED` rather than a bare `DENY`. For a purpose the **caller declares** in its request, the failed check is the whole answer.

## The four outcomes

| Decision          | Meaning                                                                                                                                                                          |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ALLOW`           | Permitted. Any obligations returned must still be honored                                                                                                                        |
| `CONDITIONAL`     | Permitted only if the caller honors the obligations — returned for a `STEP_UP` obligation, or for a permit marked **Conditional permit** (`@effect("CONDITIONAL")`)              |
| `DENY`            | Refused — by a forbid, by a failed check above, by a mandatory obligation the caller cannot honor, or because the privacy state could not be read                                |
| `REVIEW_REQUIRED` | No automated answer — the subject is unknown, the lawful authority is missing or invalid, the notice changed materially with `RE_PROMPT`, or a `HUMAN_REVIEW` obligation applies |

Callers that read only the access decision see `ALLOW` for an unconditional `ALLOW` and `DENY` for everything else, so a caller that cannot honor obligations or arrange a review fails closed.

## The privacy record

Every attribute below is present on the statements of a purpose. An absent value is encoded as `NONE`, the empty string, `0` or `-1` rather than left out, because Cedar treats reading a missing attribute as an error.

| Attribute                                                                         | Type                 | Value                                                                                                                                                     |
| --------------------------------------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `context.privacy.consentState`                                                    | String               | `GRANTED`, `DENIED`, `WITHDRAWN`, `EXPIRED` or `NONE`                                                                                                     |
| `context.privacy.consentSeqNo`                                                    | Long                 | The consent ledger sequence number evaluated; `0` when there is none                                                                                      |
| `context.privacy.consentBased`                                                    | Boolean              | Whether the purpose's lawful authority is consent-based                                                                                                   |
| `context.privacy.lawfulAuthorityType`                                             | String               | The authority's type code, or `NONE`                                                                                                                      |
| `context.privacy.authorityValid`                                                  | Boolean              | Whether the authority is `ACTIVE` and inside its validity window                                                                                          |
| `context.privacy.purposeId`, `purposeStatus`, `purposeVersionNo`                  | String, String, Long | The purpose version the record describes                                                                                                                  |
| `context.privacy.activityId`, `activityLinked`                                    | String, Boolean      | The activity the caller declared, and whether it belongs to the purpose; `activityLinked` is `true` when none was declared                                |
| `context.privacy.subjectKnown`                                                    | Boolean              | Whether the data principal is a known subject                                                                                                             |
| `context.privacy.reviewRequired`, `materialChangeBehavior`                        | Boolean, String      | Whether the consent must be re-confirmed after a material notice change, and the notice's behavior: `NO_ACTION`, `NOTIFY`, `RE_PROMPT`, `BLOCK` or `NONE` |
| `context.privacy.dataCategories`                                                  | Set of strings       | Data categories the caller declared — test with `.contains("FINANCIAL")`                                                                                  |
| `context.privacy.subjectLocation`, `establishment`, `relationshipType`, `channel` | String               | Context the caller supplied, or empty                                                                                                                     |
| `context.privacy.riskScore`                                                       | Long                 | A risk score the caller supplied, or `-1`                                                                                                                 |

The Access Gateway declares no data categories or location, so on the gateway these attributes are empty and `channel` is `web`.

## Obligations

Obligations are what the caller must do when a permit decides the request. They are annotations on a `permit` statement, and the builder's **Obligations** list writes them for you: **Obligation**, **Parameters** (a `key=value;key=value` list such as `fields=pan;pattern=LAST_4`) and **Mandatory**. In Cedar, `@obligation`, `@obligation2`, `@obligation3` and so on each name one obligation, with `@obligationN_params` and `@obligationN_mandatory("true")` beside it.

The types are `MINIMIZE`, `MASK`, `RESTRICT`, `RETAIN`, `DELETE_AFTER`, `NOTIFY`, `LOG`, `STEP_UP` and `HUMAN_REVIEW`. `STEP_UP` turns the outcome into `CONDITIONAL`; `HUMAN_REVIEW` turns it into `REVIEW_REQUIRED`. A type the engine does not know is ignored.

Only the statements that determined an `ALLOW` contribute obligations, and their obligations are combined. A **mandatory** obligation the caller has not said it can honor turns the decision into `DENY` with the reason `Mandatory obligation MASK is not supported by the caller; denied safely (ENF-006)`, so nothing proceeds under an obligation nobody will apply. Obligations are returned on privacy decisions only — a policy that names no purpose returns none, which is what the builder's warning `Obligations are returned on privacy decisions only` is telling you.

## Enforcement points

Two entry points ask the same engine the same question, so a policy decides identically for a person browsing through the Access Gateway and for an application calling a guarded API method. Neither declares a purpose: the policies on the resource do.

### The Access Gateway

Once a URI pattern's entitlement checks have passed, the gateway asks the engine about the pattern's resource, and about the pattern method's resource when the method has its own, with the HTTP method as the action. The visiting user is the data principal. Nothing privacy-specific is configured on the pattern, and anonymous requests are not asked about.

| Property                                         | Default | What it decides                                                                                                   |
| ------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `org.openiam.pbac.gateway.enabled`               | `false` | Whether the gateway asks the engine at all. Off by default, so a deployment without PBAC keeps proxying unchanged |
| `org.openiam.pbac.gateway.timeout.ms`            | `500`   | Longest a proxied request waits for a decision. Beyond it the request is refused                                  |
| `org.openiam.pbac.gateway.threads`               | `32`    | Threads kept for gateway decisions. When all are busy a further request is refused at once                        |
| `org.openiam.pbac.gateway.supported.obligations` | empty   | The obligation types the applications behind the gateway honor, comma-separated — for example `MASK,LOG`          |
| `org.openiam.pbac.gateway.no.policy.cache.ms`    | `60000` | How long a resource the engine reports no policy for is passed without asking again                               |

These are properties of the `openiam-esb` service, set by the deployment owner with a restart.

| The engine answers                                                                      | The gateway                                                                                                                                                                                          |
| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| No activated policy applies                                                             | Passes the request; the entitlement result stands, and no decision-log entry is written                                                                                                              |
| `ALLOW`                                                                                 | Passes the request, and forwards any obligations to the application in the `X-OpenIAM-Privacy-Obligations` request header                                                                            |
| `CONDITIONAL` or `REVIEW_REQUIRED`                                                      | Refuses the request. The gateway cannot step up or arrange a review on the application's behalf                                                                                                      |
| `DENY` because consent is missing, withdrawn, declined, expired or must be re-confirmed | Sends a browser to the consent page, or answers an API call with 401 — see [Ask for consent at the gateway](https://docs.openiam.com/administration-guide/privacy/enforce-consent-at-the-gateway.md) |
| Any other `DENY`                                                                        | Refuses the request as a failed entitlement check does                                                                                                                                               |
| No usable answer within the timeout                                                     | Refuses the request                                                                                                                                                                                  |

The obligations header lists each obligation as its type, with `!` when it is mandatory and the parameters in brackets, comma-separated: `MASK!(fields=pan;pattern=LAST_4),LOG`. It reaches the application as a request header in the same way a **Set Header** rule does — see [Give the application the authenticated identity](https://docs.openiam.com/administration-guide/gateway/inject-identity.md#headers-a-pbac-decision-adds).

### Guarded API methods

Webconsole and SelfService REST methods guarded by PBAC ask the same question before they run. Two additions serve privacy, both declared in code by the developer of the method: the obligations the method honors, and the argument naming the OpenIAM user whose data the method processes when that is somebody other than the caller — an agent opening a customer's record. Without it, the caller is the data principal. How to declare them is a Developer Guide matter.

| The engine answers          | The method                                                                                                                                                                                                                 |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ALLOW`                     | Runs                                                                                                                                                                                                                       |
| `CONDITIONAL`               | Runs only when every obligation is one the method declared it honors                                                                                                                                                       |
| `DENY` or `REVIEW_REQUIRED` | Is refused with 401. When the refusal is a consent refusal, the response carries the `X-OpenIAM-Privacy-Decision` header and the message `Your consent for the purpose <id> is required before this request can go ahead.` |
| No activated policy applies | Is refused. As the engine decided nothing, the refusal appears in the application's log, not in the decision log                                                                                                           |

## Roll a consent policy out

The staged rollout in [Roll a policy out safely](https://docs.openiam.com/administration-guide/pbac/roll-out-a-policy.md) applies, with two differences.

**Simulation does not evaluate privacy.** A simulation run supplies no privacy record, so a statement that reads `context.privacy` cannot be simulated. Use `SHADOW` and the decision log instead.

{% hint style="danger" %}
**Put an enforced policy on the resource before you shadow a consent policy on it.** While the only policies on a resource that name a purpose are in `SHADOW` and no enforced policy applies to it, requests to that resource are refused with `No activated policy applies to the resource; configured default is DENY (CTX-003)`. With an enforced access policy already deciding the resource — the break-glass permit for your administrators, for example — the shadow policy is observed and changes nothing.
{% endhint %}

A consent policy is felt only after the engine has picked it up — see [Caching and propagation](https://docs.openiam.com/administration-guide/pbac/pbac-reference.md#caching-and-propagation) — and the gateway also remembers a resource with no policy for `org.openiam.pbac.gateway.no.policy.cache.ms`. Allow for both before you judge the first result.

**Do not put a consent policy on the SelfService paths.** The Privacy Center is where people grant consent; a policy that requires consent to reach it leaves nobody able to give it.

## Decision log and evidence

Privacy decisions appear in the [decision log](https://docs.openiam.com/administration-guide/pbac/trace-a-decision.md) with **Class** `Privacy`. Filter by **Class** and **Purpose id** to find them. The **Purpose**, **Obligations** and **Duration** columns fill in, the **Class** column shows **Context** — where the privacy state came from, `REDIS`, `MQ` or `UNAVAILABLE` — and the **Shadow / RBAC** column compares the served decision with what the shadow policies and, at the gateway, the entitlement check decided. `CONDITIONAL` and `REVIEW_REQUIRED` show as their own badges.

The underlying `PBAC_REQUEST` audit event carries more than the screen shows. Search it in **Administration → Log Viewer** and read these attributes:

| Attribute                                                         | Holds                                                                                     |
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `PBAC_DECISION_CLASS`                                             | `ACCESS` or `PRIVACY`                                                                     |
| `PBAC_DECISION`                                                   | The four-valued outcome                                                                   |
| `PBAC_PURPOSE`                                                    | The purposes evaluated                                                                    |
| `PBAC_SUBJECT_REF`                                                | The data principal's privacy subject reference — not the person's name                    |
| `PBAC_OBLIGATIONS`                                                | The obligations returned, mandatory ones suffixed with `!`                                |
| `PBAC_CONSENT_SEQ`                                                | The consent ledger sequence number evaluated                                              |
| `PBAC_CONTEXT_SOURCE`                                             | `REDIS`, `MQ` or `UNAVAILABLE`                                                            |
| `PBAC_MISSING_CONTEXT`                                            | What the engine needed and did not have — `subject`, `lawfulAuthority`, `privacy-context` |
| `PBAC_RBAC_DECISION`, `PBAC_SHADOW_DECISION`, `PBAC_WOULD_CHANGE` | The comparison the **Shadow / RBAC** column summarizes                                    |
| `PBAC_DURATION_MS`, `PBAC_CONTRACT_VERSION`                       | How long the decision took, and the contract version `2.0`                                |

The event's info line reads `PBAC Privacy Decision: <OUTCOME> — <rationale>`, and the stored request holds identifiers and versions only. The audit result is a failure only when the engine could not decide — an unreadable privacy state, a Cedar error — never because the answer was `DENY`.

After the answer has been served, the engine also reports each privacy decision to the Privacy module, once per purpose evaluated. The Privacy module stores it as decision evidence in its evidence chain under the same correlation id and emits a `DECISION_EVALUATED` event. Reporting never delays or changes the served decision.

## Failure behavior

Every failure on the privacy path fails closed.

| Failure                                                       | Behavior                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Projection entry missing or unreadable                        | Resolved through the Privacy module; the projection is rewritten                                                                                                                                                                                                     |
| Redis unavailable                                             | The same resolve path, one round trip slower                                                                                                                                                                                                                         |
| Privacy module unreachable or slower than the resolve timeout | The purpose's state counts as unavailable: its permits cannot apply; a declared purpose is `DENY`. The entry is a failure with context source `UNAVAILABLE` and the rationale `Privacy context unavailable (…); privacy-sensitive processing fails closed (ENF-009)` |
| Cedar reports an error                                        | `DENY`, logged as a failure                                                                                                                                                                                                                                          |
| Declared purpose, no activated policy applies                 | `org.openiam.pbac.privacy.no.policy.outcome`, `DENY` as shipped                                                                                                                                                                                                      |
| Gateway gets no answer within its timeout                     | The request is refused                                                                                                                                                                                                                                               |
| Reporting the decision to the Privacy module fails            | Logged; the served decision stands                                                                                                                                                                                                                                   |

## When it goes wrong

| Symptom                                                                                    | Likely cause                                                                                  | Resolution                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A consent policy has no effect at the gateway                                              | `org.openiam.pbac.gateway.enabled` is `false`, or the engine has not yet picked the policy up | Have the deployment owner enable the gateway check; wait for the policy sweep and the gateway's no-policy memory, then retry                                                                 |
| The decision log shows `REVIEW_REQUIRED` with missing context `subject`                    | The person has never opened the Privacy Center, so no privacy subject is linked to them       | Have them open SelfService → **Privacy Center** once; the visit creates the link                                                                                                             |
| `DENY` with `No consent recorded for this purpose` although the person says they consented | They consented to a different purpose, or under a different privacy tenant                    | Look the person up in [Look up a person's consent](https://docs.openiam.com/administration-guide/privacy/look-up-consent.md) and compare the purpose id with the policy's `@privacy_purpose` |
| `DENY` with `Mandatory obligation … is not supported by the caller`                        | The obligation is mandatory and the gateway or method has not declared it                     | Add the type to `org.openiam.pbac.gateway.supported.obligations`, or make the obligation not mandatory                                                                                       |
| A permit with `STEP_UP` or **Conditional permit** never lets anyone through the gateway    | The gateway refuses `CONDITIONAL`                                                             | Use a plain permit for gateway resources; keep conditional permits for callers that can honor them                                                                                           |
| Every request to a resource is refused while the consent policy is still in `SHADOW`       | No enforced policy applies to the resource                                                    | See the warning under [Roll a consent policy out](#roll-a-consent-policy-out)                                                                                                                |
| Entries are failures with context source `UNAVAILABLE`                                     | The Privacy module did not answer within `org.openiam.pbac.privacy.resolve.timeout.ms`        | Check the Privacy module's [Health](https://docs.openiam.com/administration-guide/privacy/operate-the-privacy-service.md) screen and the `privacy-manager` service                           |

## Related

* [Record privacy and consent](https://docs.openiam.com/administration-guide/privacy.md) — purposes, lawful authorities, notices and the consent ledger this page reads
* [Ask for consent at the gateway](https://docs.openiam.com/administration-guide/privacy/enforce-consent-at-the-gateway.md) — what a person sees when a consent policy refuses them
* [Create a policy](https://docs.openiam.com/administration-guide/pbac/create-a-policy.md) — the builder the **Privacy** section is part of
* [Trace a decision](https://docs.openiam.com/administration-guide/pbac/trace-a-decision.md) — the decision log, filtered to privacy decisions
* [PBAC reference](https://docs.openiam.com/administration-guide/pbac/pbac-reference.md) — the service, cache intervals and properties


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openiam.com/administration-guide/pbac/privacy-decisions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
