Technical Interface Diagram

Complete map of page → API → pipeline → database interfaces across the solution

Frontend Pages → API Endpoints

8 pages · 33 endpoint calls
Dashboard/
4s poll
GET/api/dashboard/stats
GET/api/dashboard/activity
GET/api/dashboard/risk-trend
GET/api/notifications
POST/api/notifications/{id}/read
POST/api/notifications/read-all
Agent Console/agents
GET/api/agents
GET/api/agents/{id}
GET/api/agents/{id}/activity
GET/api/agents/{id}/trust-history
POST/api/agents
POST/api/agents/{id}/suspend
POST/api/agents/{id}/activate
Agent Compare/agents/compare
GET/api/agents
POST/api/agents/compare
Transactions/transactions
4s poll
GET/api/transactions
POST/api/transactions
POST/api/transactions/{id}/approve
POST/api/transactions/{id}/reject
POST/api/transactions/bulk-review
Rules Engine/rules
GET/api/rules
POST/api/rules/{id}/toggle
GET/api/thresholds
PUT/api/thresholds
GET/api/agents
POST/api/simulate
Audit Trail/audit
GET/api/audit
GET/api/audit/export
Consent Registry/consents
GET/api/consents
POST/api/consents
POST/api/consents/{id}/revoke
GET/api/agents
Axios HTTP · JSON request/response

API Endpoint Catalog

FastAPI · /api prefix · 33 endpoints

Dashboard

get/api/dashboard/stats— 5 headline metrics + risk distribution
get/api/dashboard/activity— Audit event feed (polling)
get/api/dashboard/risk-trend— 24-hour hourly risk/volume data

Notifications

get/api/notifications— List with unread count
post/api/notifications/{id}/read— Mark one read
post/api/notifications/read-all— Mark all read

Agents

get/api/agents— List all agents
get/api/agents/{id}— Detail + recent transactions
post/api/agents— Register new agent
put/api/agents/{id}— Update trust_score / auth_mode
post/api/agents/{id}/suspend— Suspend + cancel pending tx
post/api/agents/{id}/activate— Reactivate agent
get/api/agents/{id}/activity— 7-day daily volume
get/api/agents/{id}/trust-history— Trust score change log
post/api/agents/compare— Side-by-side full profile

Transactions

get/api/transactions— List, filterable by status
post/api/transactions— Ingest → decision pipeline
post/api/transactions/{id}/approve— Approve pending
post/api/transactions/{id}/reject— Reject pending
post/api/transactions/bulk-review— Approve/reject batch

Rules & Thresholds

get/api/rules— All 10 guardrail rules
post/api/rules/{id}/toggle— Enable/disable a rule
put/api/rules/{id}— Update severity
get/api/thresholds— 5 authorization ceilings
put/api/thresholds— Update with ordering validation

Simulation

post/api/simulate— Dry-run pipeline, no persist

Audit

get/api/audit— Filterable event log
get/api/audit/export— Full JSON export

Consents

get/api/consents— List by status
post/api/consents— Grant new consent
post/api/consents/{id}/revoke— Revoke + cancel pending

System

get/api/health— Health check
get/api/pipeline/steps— Pipeline step metadata
pipeline.py · async internal calls

Internal Pipeline Interfaces

pipeline.py + server.py helpers
POST /transactionsrun_decision_pipeline()(tx_data dict)
run_decision_pipelineIdentity Check(agents collection lookup)
run_decision_pipelinecalculate_risk_score()(amount, agent, thresholds)
run_decision_pipelineevaluate_rule() × N(each active rule + consents)
run_decision_pipelineTiered Decision(triggered_rules + thresholds)
run_decision_pipelinereturn(decision, risk_score, reasoning[], triggered_rules[])
server.pywrite_audit()(event_type, category, actor, details)
server.pycreate_notification()(type, title, message, link (on escalate/block))
server.pyrecord_trust_change()(agent_id, score, reason (on create/update/suspend/activate))
Motor async driver · BSON

Database Collections & Writers

MongoDB · 8 collections
agents

id, name, type, trust_score, auth_mode, status, certificate_status, daily_tx_count, daily_tx_total, last_activity

Writers: POST /agents, /suspend, /activate, PUT /agents, POST /transactions

transactions

id, agent_id, amount, recipient{}, consumer_id, risk_score, status, decision_tier, triggered_rules[], reasoning[], reviewed_by

Writers: POST /transactions, /approve, /reject, /bulk-review, /suspend, /revoke

rules

id, rule_key, name, description, enabled, severity, category

Writers: POST /rules/toggle, PUT /rules

thresholds

id, auto_execute_ceiling, supervised_ceiling, hard_block_floor, daily_agent_limit, max_tx_velocity

Writers: PUT /thresholds

consents

id, consumer_id, consumer_name, agent_id, permissions{6}, scope, status, granted_at, expires_at, revoked_at

Writers: POST /consents, /revoke

audit_log

id, event_type, event_category, actor, details{}, timestamp, hash (SHA-256)

Writers: All mutating endpoints (append-only)

notifications

id, type, title, message, link, meta{}, read, created_at

Writers: POST /transactions (auto), /bulk-review

trust_history

id, agent_id, agent_name, trust_score, reason, timestamp

Writers: POST /agents, /suspend, /activate, PUT /agents

End-to-End Data Flow

Operator Browser

React SPA

HTTPS REST

JSON + CORS

FastAPI Router

Pydantic validation

Decision Pipeline

5-step state machine

Side Effects

Audit · Notif · Trust

MongoDB Motor

8 collections