Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a Consent Receipt Lifecycle and Data-Sharing Access Verifier
Format
Code-aware
Lines
84
Sections
11
Linked challenge
Build a Consent Receipt Lifecycle and Data-Sharing Access Verifier
Prompt source
Original prompt text with formatting preserved for inspection.
84 lines
11 sections
No variables
1 code block
## Build
Inspect standardized digital consent receipts against active merchant data queries across open networks. Verify data disclosure limits, validity horizons, and revocation records to block unauthorized credential requests.
## User
Enterprise privacy and compliance officer
## Workflow
1. Ingest mock structured consent receipts conforming to electronic consent specifications and Beckn context headers.
2. Parse requester service types, data purpose codes, and permitted attribute retrieval scopes.
3. Cross-examine incoming buyer application data requests against active revocation registries.
4. Export verifiable consent compliance scorecards and quarantine non-compliant data access requests.
## Interface
Compliance log console with policy rule match meters, access permit diffs, and revocation lookup status.
## Data
Generate synthetic JSON consent artifacts and sample data fetch requests modeling standard open network interactions.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Beckn protocol specifications](https://raw.githubusercontent.com/beckn/protocol-specifications/master/README.md)
Adopts Beckn context header attributes (bap_id, bpp_id, timestamp) to establish consent transaction boundaries.
## Tools
pydantic-ai, fastapi, pytest.
Guarantees strict schema conformity and cryptographic field integrity on incoming consent receipt objects.
Structured JSON reasoning model accessed via standard API or local Ollama endpoint.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Detects expired consent artifacts based on timestamp and validity duration checks.
- Identifies data scope overreach when queries request attributes omitted from the initial consent receipt.
- Flags revoked consent handles immediately prior to data fetch dispatch.
## Starter Examples
```json
[
{
"input": {
"receipt_id": "CR-7721",
"granted_to": "bap.network.in/health",
"purpose_code": "TELEMED_CONSULT",
"permitted_fields": [
"allergies",
"active_medications"
],
"valid_until": "2024-12-31T23:59:59Z",
"status": "active",
"request_payload": {
"requested_fields": [
"allergies",
"active_medications"
]
}
},
"expected_output": {
"verdict": "permitted",
"scope_violation": false,
"expired": false,
"audit_code": "CONSENT_OK"
}
},
{
"input": {
"receipt_id": "CR-7722",
"granted_to": "bap.network.in/retail",
"purpose_code": "DELIVERY_FULFILLMENT",
"permitted_fields": [
"shipping_address"
],
"valid_until": "2024-12-31T23:59:59Z",
"status": "revoked",
"request_payload": {
"requested_fields": [
"shipping_address",
"phone_number"
]
}
},
"expected_output": {
"verdict": "blocked",
"scope_violation": true,
"expired": false,
"audit_code": "CONSENT_REVOKED_AND_SCOPE_BREACH"
}
}
]
```
## Safety
Maintains a simulated policy review sandbox; does not process actual identity credentials or health records.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.