oConsent
Examples ยท Illustrative flows

OConsent Examples

Two end-to-end consent flows: an AI training gate and an agent memory permission, with the records, checks, and audit events involved.

Note

These examples are illustrative and static. They show the shape of the records and decisions, not a live service.

Example 01

AI training gate

A dataset contains user conversation exports. Before a fine-tuning job uses each asset, the pipeline calls verify() for purpose llm_training.

dataset row → consent lookup → verify purpose=llm_training → allow / deny → audit event
Dataset row
dataset_row.json
{
  "row_id": "row_0481",
  "subject": "user_123",
  "asset": "conversation_export"
}
Consent record
consent_record.json
{
  "id": "rec_7f3a",
  "subject": "user_123",
  "asset": "conversation_export",
  "purpose": "llm_training",
  "actor": "model_pipeline_7",
  "status": "active"
}
Verification request
verification_request.json
{
  "subject": "user_123",
  "asset": "conversation_export",
  "purpose": "llm_training",
  "actor": "model_pipeline_7"
}
Verification response (allow)
verification_response.json
{
  "allowed": true,
  "decision": "allow",
  "reason": "active_consent_record_found",
  "consent_record_id": "rec_7f3a",
  "audit_event_id": "audit_91ac"
}
Audit event
audit_event.json
{
  "id": "audit_91ac",
  "consent_record_id": "rec_7f3a",
  "actor": "model_pipeline_7",
  "asset": "conversation_export",
  "purpose": "llm_training",
  "decision": "allow",
  "enforcement_point": "fine_tuning_pipeline"
}
Example 02

Agent memory permission

An AI agent wants to store a user-provided fact in long-term memory. OConsent verifies whether the agent may remember the fact for purpose agent_memory, and the result changes after revocation.

user fact → verify purpose=agent_memory → allow → store → revoke → verify → deny
User fact
user_fact.json
{
  "subject": "user_123",
  "asset": "user_fact_8842",
  "fact": "Prefers vegetarian restaurants"
}
Consent record
consent_record.json
{
  "id": "rec_4c10",
  "subject": "user_123",
  "asset": "user_fact_8842",
  "purpose": "agent_memory",
  "actor": "assistant_agent_2",
  "status": "active"
}
Verification request
verification_request.json
{
  "subject": "user_123",
  "asset": "user_fact_8842",
  "purpose": "agent_memory",
  "actor": "assistant_agent_2"
}
Verification response (allow)
verification_response.json
{
  "allowed": true,
  "decision": "allow",
  "reason": "active_consent_record_found",
  "consent_record_id": "rec_4c10"
}
Revocation event
revocation_event.json
{
  "id": "rev_77a2",
  "consent_record_id": "rec_4c10",
  "subject": "user_123",
  "reason": "user_requested_revocation"
}
Verification response after revocation (deny)
verification_response.json
{
  "allowed": false,
  "decision": "deny",
  "reason": "consent_revoked",
  "consent_record_id": "rec_4c10"
}

See the full model.

These flows use the objects defined in the draft specification. Read the spec or the developer guide to implement them.