Skip to main content

Data model

Firestore collections and Cloud Storage buckets are grouped by subsystem. Cloud Functions are the only trusted writers for cross-user or agent-owned state.

Collection map

AreaOwnerPurposeKey collections
identityIdentity callablesAgents, device keys, scoped keys, secrets, delegationsagents, agents/{id}/deviceKeys, agents/{id}/scopedKeys, agents/{id}/secrets
postboxInbox callablesMailboxes, inbound/outbound messages, approvals, bouncesagents/{id}/mailbox, agents/{id}/messages, agents/{id}/outbound
memoryProvenance callablesMarkdown-first agent memory plus derived search/index stateagents/{id}/memoryFiles plus Cloud Storage objects
advanced networkingDirect-route compatibilityHostnames, cert ledger, IP historyagents/{id}/gateway/*
advanced schedulerDirect-route compatibilityJobs and runsagents/{id}/jobs, run subcollections
advanced artifactsDirect-route compatibilityFile grants and signed URLsagents/{id}/artifacts plus Cloud Storage
budgetsBudget callablesPolicy, decisions, budgets, alertsbudgets, usage collections
auditCross-cuttingHash-chained event ledger and exportsaudit/*, agents/{id}/audit/*

Ownership: the agentId claim

Agent-owned paths are nested under agents/{agentId}. Agent callables resolve agentId from Firebase token claims minted by session, not from caller-sent request bodies.

Security Rules policy

Client Firestore rules stay deny-by-default for privileged agent data. Reads and writes that cross trust boundaries go through Cloud Functions, which use Firebase Admin credentials and append audit rows where required.

Hash-chained audit

Audit rows carry a previous hash and row hash. Offline export verifies the chain and signed manifest; scheduled verification anchors roots for later evidence checks.

Critical indexes

A handful of indexes carry the platform's performance. Most of them come from migration 0068's advisor fixes:

  • Inbox message/outbound indexes by agent and timestamp.
  • Provenance search indexes by agent, type, tags, and updated timestamp.
  • Advanced networking indexes by agent and hostname.
  • Advanced scheduler run indexes by agent, job, and started timestamp.

Tunables via identity.settings

Operator-adjustable knobs live in identity.settings (key jsonb, value jsonb) and are surfaced by /settings/list and /settings/set. Today's keys include:

KeyTypeDefaultMeaning
postbox_retention_daysint90Hard-delete sent/read messages past this.
memory_retention_daysint180Trim old turns.
artifacts_ttl_daysint30Default expiry for newly registered artifacts.

See the per-subsystem pages for the full list.