> For the complete documentation index, see [llms.txt](https://docs.openg2p.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openg2p.org/platform/platform-services/consent-management/design.md).

# Design

This section specifies the design of the Consent Manager (CM). It is **API-first** — the contract is documented before any UI — and is organised so you can read it top to bottom.

CM follows the OpenG2P platform **4-API audience pattern** (staff / beneficiary / agent / partner): today it ships a **staff** API and a **partner** API, with a **beneficiary** API scaffolded for later and no agent API — one Helm chart and one image, a Deployment per audience. Partner identity and signing keys are owned by **Partner Management (PM)** — CM fetches partner keys from PM and holds only a policy binding — and data-share **policy changes** are approved through the shared **Approval Workflow Engine (AWE)**.

| Page                                                                                                                      | What it covers                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Architecture](/platform/platform-services/consent-management/design/architecture.md)                                     | Components, the PDP/PEP model, the API-audience split, PM and AWE integration, registry integration, end-to-end sequence diagrams, information flow. |
| [Data model](/platform/platform-services/consent-management/design/data-model.md)                                         | Canonical entities and the JSON-LD documents — consent object, auth context, artefact, receipt — plus the partner policy binding and policy records. |
| [Verification & enforcement](/platform/platform-services/consent-management/design/verification-and-enforcement.md)       | The **primary** flow: a partner embeds a signed consent object, the CM validates it and returns the effective fields.                                |
| [Partner onboarding & policy](/platform/platform-services/consent-management/design/partner-onboarding-and-policy.md)     | How partner policy bindings and versioned data-share policies are managed and evaluated.                                                             |
| [Partner Management integration](/platform/platform-services/consent-management/design/partner-management-integration.md) | How CM fetches and caches partner verifying keys from PM, and holds only a policy binding (no partner identity or keys of its own).                  |
| [Approval Workflow integration](/platform/platform-services/consent-management/design/approval-workflow-integration.md)   | How CM gates data-share policy widening through AWE — pending version, proxied approvals inbox, HMAC webhook, activate/supersede.                    |
| [Consent lifecycle](/platform/platform-services/consent-management/design/consent-lifecycle.md)                           | The **secondary** flow: originating consent (request → authenticate → approve → artefact → receipt), revocation, and expiry.                         |
| [Security & trust](/platform/platform-services/consent-management/design/security-and-trust.md)                           | Signing and key management, ID-token validation, replay protection, and the threat model.                                                            |
| [Standards & best practices](/platform/platform-services/consent-management/design/standards-and-best-practices.md)       | Alignment with Kantara/ISO 27560, GDPR, DEPA/AA, and DCI/OIDC — and the gaps we deliberately close.                                                  |

The full HTTP contract lives under [API Reference](/platform/platform-services/consent-management/api.md).


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.openg2p.org/platform/platform-services/consent-management/design.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
