Security and data flow
Memrain runs in your AWS account, and nobody operates it for you. This page says what stays there, what leaves, and which parts are still your job.
Data flow
One Terraform stack per deployment. The only content that leaves AWS is what your agent retrieves, on its way to that agent's model.
What stays, what leaves
Stored data stays in your AWS account. Passages your agent retrieves go to that agent's model, under your agreement with that provider. With the default Cloudflare Tunnel, requests pass through Cloudflare. Caddy mode takes Cloudflare out of the path.
| Flow | What it carries | Leaves your AWS account? |
|---|---|---|
| Agent client to ingress | The MCP request and its credential | Yes, on the way in. Through Cloudflare in Tunnel mode, direct in Caddy mode. |
| Memrain to RDS and EFS | Pages, chunks, embeddings, facts, config | No. Encrypted storage. |
| Memrain to Bedrock Titan v2 | Chunk and query text, for embeddings | No. Bedrock in your account. |
| Memrain to Bedrock Claude | Query or chunk text, only for opt-in features | Stays in AWS, within the EU regions of the inference profile. |
| Response to your agent | Retrieved passages with source pointers | Yes. Your agent sends them to its model to write the answer. |
| Telemetry to a vendor | Nothing | No vendor analytics, no third-party telemetry. |
Model calls
Embeddings come from Amazon Titan v2 on Amazon Bedrock in your AWS account. Optional Claude calls (Haiku 5.5, Sonnet 5.5) use EU cross-region inference profiles by default, and IAM denies Claude invocation outside the allowed regions.
Telemetry
No vendor analytics and no third-party telemetry. Memrain keeps its own usage counters (aggregate search telemetry, request and spend logs) and CloudWatch application logs with 14-day retention, all inside your account.
Secrets
Runtime credentials live in AWS Secrets Manager. Terraform generates the initial database password, the public bearer and the internal token, so those values are also in your Terraform state. Keep the state bucket encrypted and access-restricted.
People and credentials
Each person gets their own credential: a personal access token, or a one-time enrollment code redeemed through your organisation's connector. You can revoke one person without touching anyone else.
The connector is a built-in OAuth 2.1 authorization server with PKCE. It is not single sign-on: there is no SAML, no OpenID Connect federation and no SCIM.
Credential changes are recorded: who issued, revoked or replaced an enrollment, and who changed a grant. A per-request log is opt-in and has no retention limit yet. CloudTrail is on by default in the Terraform stack, with 90-day S3 retention, and can be turned off. The admin panel has its own sign-in and a strict Content-Security-Policy.
Spend caps on model calls
Daily USD caps per connector, token or person, plus an optional brain-wide daily cap. Caps apply to priced model calls, and some costs are approximations, so treat a cap as a control and keep an eye on the AWS bill.
Redaction on ingest
Credential-shaped text is redacted before it is stored: vendor keys, JWTs, PEM private keys, passwords in URLs, Basic and Bearer credentials, and high-entropy KEY= or TOKEN= assignments. Imported chat history is redacted on the way in too.
Retrieval output to non-operator callers is scanned and redacted, and memrain secrets audit rescans what is already stored. No pattern set is complete, so rotate a leaked credential first.
Isolation is application-layer
Each person can have a private space (a source). Enforcement is in the application layer. It is pilot-grade: it needs MEMRAIN_TENANT_FAIL_CLOSED=1 and Dynamic Client Registration off, and its known limits are documented.
If you need legally required separation, run one stack per team.
Network access
With the Cloudflare Tunnel, the instance opens no inbound ports. SSH is off unless you allow a CIDR, and SSM Session Manager is the default access path. Caddy mode opens HTTPS on the instance.
Optional VPC interface endpoints for Bedrock, Secrets Manager, SSM and CloudWatch Logs keep AWS API traffic on the AWS network. They cost about $43 a month extra and are off by default.
Backups
RDS automated backups with 7-day retention, encrypted storage, deletion protection and a final snapshot on destroy. RDS runs single-AZ, on one EC2 instance. High availability is not offered.
A restore drill, RTO and RPO are not provided. Run a restore in your pilot and write down your own figures.
Reporting a vulnerability
Please do not open a public issue. Report privately through GitHub's private vulnerability reporting: the repository's Security tab, then Report a vulnerability. Expect a first reply within five business days, and coordinated disclosure once a fix lands. That is a target, not an SLA.
There is no third-party audit or compliance attestation. The code is open for your own review.