# privacy-tech-lab/gpc-ai-agents-prototypes architecture

> Architecture diagram of the GitHub repository privacy-tech-lab/gpc-ai-agents-prototypes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/privacy-tech-lab/gpc-ai-agents-prototypes
- Repository: https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes

## Overview

This repository is a suite of eight experimental AI-agent workflows, each testing where and how a Global Privacy Control (GPC) or related privacy policy is enforced. The common user journey is a request entering an orchestrator, passing through that prototype’s enforcement boundary, and reaching tools or downstream uses; the primary task may remain available even when secondary data use is blocked. The graph preserves the README’s distinct enforcement approaches. Some internal wiring is inferred only from the README and file tree, so uncertain links are omitted.

Main entry points: [`prototype-3/orchestrator.js`](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/orchestrator.js) (P3 orchestrator), [`prototype-6/orchestrator.js`](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/orchestrator.js) (P6 orchestrator), [`prototype-2/orchestrator/orchestrator.js`](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-2/orchestrator/orchestrator.js) (P2 orchestrator), [`prototype-4/orchestrator/orchestrator.js`](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/orchestrator/orchestrator.js) (P4 orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflows["Agent workflows"]
  node_p1["P1 orchestrator<br/>[orchestrator.js]"]
  node_p2["P2 orchestrator<br/>[orchestrator.js]"]
  node_p3["P3 orchestrator<br/>[orchestrator.js]"]
  node_p4["P4 orchestrator<br/>[orchestrator.js]"]
  node_p5["P5 orchestrator<br/>[orchestrator.js]"]
  node_p6["P6 orchestrator<br/>[orchestrator.js]"]
  node_p7["P7 orchestrator<br/>[orchestrator.js]"]
  node_p8["P8 orchestrator<br/>[orchestrator.js]"]
end

subgraph group_controls["Privacy controls"]
  node_p1policy["MCP GPC interceptor<br/>[gpc_policy.js]"]
  node_p2gate["Purpose gate"]
  node_p3registry["Consent tool registry<br/>[tool_registry.js]"]
  node_p3gate["Consent gate<br/>[consent_gate.js]"]
  node_p4baggage["GPC baggage<br/>[baggage.js]"]
  node_p5firewall["Inference firewall"]
  node_p6gate["Collection gate<br/>[collection_gate.js]"]
  node_p7gate["Persistence gate"]
  node_p8gate["Delegation tier gate<br/>[delegation_gate.js]"]
end

subgraph group_execution["Tools and services"]
  node_p1storage["Profile storage<br/>[storage.js]"]
  node_p2services["Secondary purposes"]
  node_p3tools["MCP tools<br/>[tool_handlers.js]"]
  node_p4sites["Publisher enforcement<br/>[site_handlers.js]"]
  node_p5engine["Attribute inference"]
  node_p6classifier["Attribute classifier"]
  node_p8actions["Trip actions<br/>[action_handlers.js]"]
end

subgraph group_state["State and providers"]
  node_p4provider["Provider fanout<br/>[provider.js]"]
  node_p5store[("Profile store<br/>[profile_store.js]")]
  node_p6stores[("Session stores<br/>[stores.js]")]
  node_p7memory[("Agent memory<br/>[memory_store.js]")]
end

node_user(("User"))

node_user -->|"submits request"| node_p1
node_user -->|"submits request"| node_p2
node_user -->|"submits request"| node_p3
node_user -->|"submits request"| node_p4
node_user -->|"submits request"| node_p5
node_user -->|"submits request"| node_p6
node_user -->|"submits request"| node_p7
node_user -->|"submits request"| node_p8
node_p1 -->|"requests storage"| node_p1storage
node_p1storage -->|"calls MCP tools"| node_p1policy
node_p2 -->|"gates secondary uses"| node_p2gate
node_p2 -->|"fans out output"| node_p2services
node_p3 -->|"filters catalog"| node_p3registry
node_p3 -->|"checks tool consent"| node_p3gate
node_p3 -->|"calls allowed tools"| node_p3tools
node_p4 -->|"propagates signal"| node_p4baggage
node_p4 -->|"dispatches queries"| node_p4provider
node_p4provider -->|"fans out queries"| node_p4sites
node_p5 -->|"checks inference"| node_p5firewall
node_p5 -->|"derives attributes"| node_p5engine
node_p5engine -->|"writes attributes"| node_p5store
node_p6 -->|"checks collection"| node_p6gate
node_p6 -->|"requests classification"| node_p6classifier
node_p6 -->|"uses session state"| node_p6stores
node_p7 -->|"checks persistence"| node_p7gate
node_p7 -->|"reads and writes"| node_p7memory
node_p8 -->|"resolves delegation tier"| node_p8gate
node_p8 -->|"dispatches permitted actions"| node_p8actions

click node_p1 "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-1/orchestrator/orchestrator.js"
click node_p2 "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-2/orchestrator/orchestrator.js"
click node_p3 "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/orchestrator.js"
click node_p4 "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/orchestrator/orchestrator.js"
click node_p5 "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-5/orchestrator.js"
click node_p6 "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/orchestrator.js"
click node_p7 "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-7/orchestrator.js"
click node_p8 "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-8/orchestrator.js"
click node_p1policy "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-1/mcp-server/gpc_policy.js"
click node_p1storage "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-1/services/storage.js"
click node_p2gate "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-2/lib/withPurposeCheck.js"
click node_p2services "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/tree/main/prototype-2/services"
click node_p3registry "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/tool_registry.js"
click node_p3gate "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/consent_gate.js"
click node_p3tools "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/tool_handlers.js"
click node_p4baggage "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/orchestrator/baggage.js"
click node_p4provider "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/provider/provider.js"
click node_p4sites "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/services/site_handlers.js"
click node_p5firewall "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-5/inference_firewall.js"
click node_p5engine "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-5/inference_engine.js"
click node_p5store "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-5/profile_store.js"
click node_p6gate "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/collection_gate.js"
click node_p6classifier "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/inference_classifier.js"
click node_p6stores "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/stores.js"
click node_p7gate "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-7/persistence_gate.js"
click node_p7memory "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-7/memory_store.js"
click node_p8gate "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-8/delegation_gate.js"
click node_p8actions "https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-8/action_handlers.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_p1,node_p2,node_p3,node_p4,node_p5,node_p6,node_p7,node_p8,node_user toneBlue
class node_p1policy,node_p2gate,node_p3registry,node_p3gate,node_p4baggage,node_p5firewall,node_p6gate,node_p7gate,node_p8gate toneAmber
class node_p1storage,node_p2services,node_p3tools,node_p4sites,node_p5engine,node_p6classifier,node_p8actions toneMint
class node_p4provider,node_p5store,node_p6stores,node_p7memory toneRose
```

## Components

### Agent workflows

- [P1 orchestrator](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-1/orchestrator/orchestrator.js): `prototype-1/orchestrator/orchestrator.js`
- [P2 orchestrator](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-2/orchestrator/orchestrator.js): `prototype-2/orchestrator/orchestrator.js`
- [P3 orchestrator](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/orchestrator.js): `prototype-3/orchestrator.js`
- [P4 orchestrator](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/orchestrator/orchestrator.js): `prototype-4/orchestrator/orchestrator.js`
- [P5 orchestrator](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-5/orchestrator.js): `prototype-5/orchestrator.js`
- [P6 orchestrator](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/orchestrator.js): `prototype-6/orchestrator.js`
- [P7 orchestrator](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-7/orchestrator.js): `prototype-7/orchestrator.js`
- [P8 orchestrator](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-8/orchestrator.js): `prototype-8/orchestrator.js`

### Privacy controls

- [MCP GPC interceptor](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-1/mcp-server/gpc_policy.js): `prototype-1/mcp-server/gpc_policy.js`
- [Purpose gate](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-2/lib/withPurposeCheck.js): `prototype-2/lib/withPurposeCheck.js`
- [Consent tool registry](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/tool_registry.js): `prototype-3/tool_registry.js`
- [Consent gate](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/consent_gate.js): `prototype-3/consent_gate.js`
- [GPC baggage](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/orchestrator/baggage.js): `prototype-4/orchestrator/baggage.js`
- [Inference firewall](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-5/inference_firewall.js): `prototype-5/inference_firewall.js`
- [Collection gate](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/collection_gate.js): `prototype-6/collection_gate.js`
- [Persistence gate](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-7/persistence_gate.js): `prototype-7/persistence_gate.js`
- [Delegation tier gate](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-8/delegation_gate.js): `prototype-8/delegation_gate.js`

### Tools and services

- [Profile storage](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-1/services/storage.js): `prototype-1/services/storage.js`
- [Secondary purposes](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/tree/main/prototype-2/services): `prototype-2/services`
- [MCP tools](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-3/tool_handlers.js): `prototype-3/tool_handlers.js`
- [Publisher enforcement](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/services/site_handlers.js): `prototype-4/services/site_handlers.js`
- [Attribute inference](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-5/inference_engine.js): `prototype-5/inference_engine.js`
- [Attribute classifier](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/inference_classifier.js): `prototype-6/inference_classifier.js`
- [Trip actions](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-8/action_handlers.js): `prototype-8/action_handlers.js`

### State and providers

- [Provider fanout](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-4/provider/provider.js): `prototype-4/provider/provider.js`
- [Profile store](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-5/profile_store.js): `prototype-5/profile_store.js`
- [Session stores](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-6/stores.js): `prototype-6/stores.js`
- [Agent memory](https://github.com/privacy-tech-lab/gpc-ai-agents-prototypes/blob/main/prototype-7/memory_store.js): `prototype-7/memory_store.js`

### Other components

- **User**

## Connections

- User → P1 orchestrator: submits request
- User → P2 orchestrator: submits request
- User → P3 orchestrator: submits request
- User → P4 orchestrator: submits request
- User → P5 orchestrator: submits request
- User → P6 orchestrator: submits request
- User → P7 orchestrator: submits request
- User → P8 orchestrator: submits request
- P1 orchestrator → Profile storage: requests storage
- Profile storage → MCP GPC interceptor: calls MCP tools
- P2 orchestrator → Purpose gate: gates secondary uses
- P2 orchestrator → Secondary purposes: fans out output
- P3 orchestrator → Consent tool registry: filters catalog
- P3 orchestrator → Consent gate: checks tool consent
- P3 orchestrator → MCP tools: calls allowed tools
- P4 orchestrator → GPC baggage: propagates signal
- P4 orchestrator → Provider fanout: dispatches queries
- Provider fanout → Publisher enforcement: fans out queries
- P5 orchestrator → Inference firewall: checks inference
- P5 orchestrator → Attribute inference: derives attributes
- Attribute inference → Profile store: writes attributes
- P6 orchestrator → Collection gate: checks collection
- P6 orchestrator → Attribute classifier: requests classification
- P6 orchestrator → Session stores: uses session state
- P7 orchestrator → Persistence gate: checks persistence
- P7 orchestrator → Agent memory: reads and writes
- P8 orchestrator → Delegation tier gate: resolves delegation tier
- P8 orchestrator → Trip actions: dispatches permitted actions
