All posts

Segregation of Duties for Long-Term Memory

When a single credential protects an entire long‑term memory store, a single mistake can expose millions of records, corrupt model embeddings, or trigger costly compliance violations. The lack of segregation of duties makes it impossible to prove who added or altered a vector, who read a confidential document, or which automated job performed a bulk update. Most teams today treat long‑term memory as a shared service. The database that holds embeddings, the Redis cache that stores session state,

Free White Paper

DPoP (Demonstration of Proof-of-Possession) + Long-Polling Security: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

When a single credential protects an entire long‑term memory store, a single mistake can expose millions of records, corrupt model embeddings, or trigger costly compliance violations. The lack of segregation of duties makes it impossible to prove who added or altered a vector, who read a confidential document, or which automated job performed a bulk update.

Most teams today treat long‑term memory as a shared service. The database that holds embeddings, the Redis cache that stores session state, or the Mongo collection that retains user profiles is often accessed through one service account or a static API key. Engineers, data scientists, and automated pipelines all use the same secret, and the connection is made directly from the application to the store. There is no per‑user audit, no real‑time review of a write operation, and no way to hide sensitive fields from a downstream consumer.

Why identity alone is not enough

Modern identity providers can issue tokens that identify a user or a service account. Those tokens can be used to limit which hosts a client may reach, but the request still travels straight to the memory store. The gateway that sits between the client and the store is missing, so the following gaps remain:

  • All reads and writes are logged only by the database itself, which often lacks user context for token‑based calls.
  • Sensitive payloads – for example, personally identifiable information embedded in a vector – are never masked before they leave the store.
  • High‑risk operations such as bulk deletions or schema changes are executed without an approval step.
  • There is no immutable session record that can be replayed for forensic analysis.

In short, the precondition of having identities in place does not provide the enforcement layer needed for true segregation of duties.

hoop.dev as the data‑path enforcement point

hoop.dev fills the missing piece by acting as a Layer 7 gateway that sits between identities and the long‑term memory store. Every connection, whether it is a PostgreSQL query, a Redis command, or a MongoDB aggregation, passes through hoop.dev before reaching the target. Because the gateway controls the data path, it can apply the following segregation of duties controls:

  • Just‑in‑time access: Users receive a short‑lived token that authorises a single operation, reducing the attack surface of long‑lived credentials.
  • Approval workflows: High‑impact commands trigger a human review step, ensuring that bulk deletes or schema migrations are vetted.
  • Inline data masking: Sensitive fields are stripped or redacted in responses before they reach the client, protecting downstream systems from accidental leakage.
  • Command‑level audit: hoop.dev records each statement, the identity that issued it, and the result, creating a reliable audit trail for compliance purposes.
  • Session replay: Recorded sessions can be replayed in a sandbox to verify that a change was performed as intended.

All of these outcomes exist only because hoop.dev occupies the data path; the underlying memory store remains unchanged and continues to operate with its native protocol.

Practical steps to achieve segregation of duties

Implementing the model does not require rewriting application code. Follow these high‑level actions:

Continue reading? Get the full guide.

DPoP (Demonstration of Proof-of-Possession) + Long-Polling Security: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.
  1. Deploy the hoop.dev gateway in the same network segment as your long‑term memory store. The quick‑start guide walks you through a Docker Compose deployment that includes OIDC authentication and default guardrails. Get started with the official guide.
  2. Register the memory store as a connection inside hoop.dev. Provide the host, port, and the credential that the gateway will use; clients never see this secret.
  3. Configure role‑based policies that map OIDC groups to allowed commands. For example, data‑science users may run SELECT queries, while admin groups can execute ALTER statements after approval.
  4. Enable inline masking for fields that contain personal data. The policy engine will replace those values in query results automatically.
  5. Turn on session recording for all write operations. The logs are stored outside the target system, giving you a reliable audit trail.

Once the gateway is in place, every client, whether it is a notebook, a CI job, or an AI‑driven agent, connects through hoop.dev using its standard client (psql, redis-cli, mongosh, etc.). The gateway enforces the segregation of duties policies you defined, and the underlying store remains oblivious to the extra controls.

Why the approach scales

Because hoop.dev works at the protocol layer, you can protect dozens of memory stores with a single policy framework. Adding a new vector database or a Redis cache does not require a new access‑control system; you simply register the target and reuse existing OIDC groups. The audit data is centralized, making it easier for auditors to locate evidence of who performed a given operation.

Moreover, the gateway’s open‑source nature lets you extend policies or integrate with custom compliance tooling without vendor lock‑in.

FAQ

What does segregation of duties mean for long‑term memory?

It means separating the responsibilities for creating, reading, updating, and deleting stored vectors or documents so that no single identity can perform all critical actions without oversight.

Does hoop.dev store my credentials?

No. The gateway holds the secret only long enough to establish a connection to the target. Clients never receive the credential, and the secret never leaves the gateway’s process.

Can I still use my existing monitoring tools?

Yes. hoop.dev emits audit events that can be forwarded to standard log aggregators or SIEMs. The gateway does not replace your monitoring stack; it complements it with richer, identity‑aware data.

Is the solution compatible with AI agents that write to memory?

Absolutely. The built‑in MCP server lets autonomous agents connect through the same gateway, so the same segregation of duties rules apply to both human and machine actors.

For deeper technical details on masking, approval workflows, and session replay, explore the learn section of the documentation.

Ready to add segregation of duties to your long‑term memory architecture? Visit the open‑source repository on GitHub to get the code and start the deployment.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts