Skip to content

Security and trust

Last updated: 2026-11-27T14:16:11-03:00 (UTC-3)

Security and current limits · Access control · Architecture · ADR 0168

This page gathers what m7gtw does to protect data and access, each item linked to the guide that covers it in detail. These are product facts, verified by tests. They are not certifications: the project has no external audit (SOC 2, ISO 27001) and no independent pentest. When the gateway is offered as a service, the company that operates it publishes its policies, audits and subprocessors separately.

Document What it answers
Secure development How each change is made, tested and scanned before it goes in
Threat model What is protected, from whom, and which test proves each defense
Data inventory What is stored, whether it is encrypted, for how long and how to delete it
Cryptography Algorithms, the origin of each key and rotation
Continuity and recovery Backup, tested restore and what is lost in each failure
Incident response How to contain, investigate and recover, with a drill
Deployment hardening What comes hardened and what is left to the operator
Third parties and licenses Licenses of what ships in the product and the external services it uses
Security assessment The penetration tests done, what they found and what changed
Vulnerability disclosure How to report a flaw and what to expect
Area What the gateway guarantees
Hosting Self-hosted: it runs on the infrastructure of whoever installs it, with its own PostgreSQL. Nothing is sent to a project service.
Credentials Client keys stored only as SHA-256; provider keys encrypted with AES-256-GCM or read from vaults. No listing returns a secret. Explicit operator key rotation supports current/previous overlap and offline atomic re-encryption, with separate backup/retirement requirements.
Content Prompts and responses do not go to logs, traces, metrics or log destinations. Eval captures and the semantic cache are encrypted; files, batches, vector stores, datasets and prompts are stored in plain text in the operator’s database.
Access OIDC SSO, SCIM, permissions by resource and action, team scope, CSRF and revocable sessions. Optional custom role ceilings restrict named users with live SQL enforcement; they never create administrative grants.
Traceability Every request has a request_id and a W3C traceparent, propagated all the way to the provider, and administrative mutations are audited.
Console and site CSP with hashes, an HttpOnly and SameSite=Strict cookie, nosniff and no-referrer.
  • What is stored by default: usage metadata (time, key, team, model, provider, status, tokens, latency and correlation IDs), not the content. Analytics · Usage durability.
  • Telemetry without content: JSON logs, OTLP traces and Prometheus metrics do not carry prompts, responses, client tokens or authorization headers. Observability.
  • Log destinations (S3, GCS, Azure Blob, Langfuse, Datadog, HTTP): they receive only metadata, never prompts or responses. Observability.
  • Content stored by operator choice, encrypted by the application:
    • eval captures: off by default, turned on by team policy; encrypted with AES-256-GCM and deleted at the end of the policy’s retention period (evals);
    • semantic cache: the response is encrypted with AES-GCM; the database does not store a readable question or answer (semantic cache);
    • exact cache: opt-in, isolated by identity, team and credential, and honors Cache-Control: no-store (exact cache).
  • Content in plain text in the database: files and batch bodies (with prompts), vector store chunks, eval datasets and results, comments and prompts. Their protection is that of the operator’s PostgreSQL (access, TLS, disk encryption). Data inventory.
  • Retention: an opt-in period deletes finalized metadata in batches, with explicit confirmation when you turn it on. Retention.
  • Client keys: generated by a CSPRNG and stored only as SHA-256. The plain value is shown once, with no-store. Revocation takes effect on the next request. Rotation.
  • Provider keys: in the YAML, they are references to environment variables or to files (<NAME>_FILE). Keys created in the console are encrypted with AES-256-GCM in PostgreSQL. There are also vaults: HashiCorp Vault, CyberArk Conjur, AWS Secrets Manager, Google Secret Manager and Azure Key Vault. If the vault fails, the gateway keeps going with the last good value, without blocking the call while it waits. ADR 0139 · ADR 0140.
  • Cloud identity (Google ADC, AWS profile, OCI API key): the credential stays where it originates and is not copied into the configuration. Providers.
  • Console: login with a bootstrap token or OIDC SSO (Authorization Code with PKCE, state and nonce), with no corporate password in the gateway. Federated logout by backchannel or initiated from the console. OIDC · Logout. Named OIDC profiles add separate issuer/client trust, explicit local subject links and durable security generations; their management flags default off. Local Keycloak qualification is distinct from native cloud-account certification.
  • Provisioning: SCIM 2.0 for users and groups, single-use invitations and bulk import. SCIM.
  • Authorization: the permission matrix by resource and action is enforced on the server, per route. Team roles only read and manage their own teams, and authorization is revalidated in the database on every request. Access control.
  • Inference: each key has route scopes, a model allowlist and its team’s policy. Plans and flags restrict access but never grant it. Plans.
  • Limits: RPM, TPM and budgets per key, team, end user and organization, failing closed when the database does not respond. Budgets and TPM.
  • Web: the console is a closed bundle, with a CSP of exact hashes. The documentation site allows each page’s inline scripts only by hash. CSRF and same-origin checks apply to every write. Bundle · ADR 0167.

  • Network egress:

    • provider and MCP URLs are defined by the administrator, not by the client;
    • webhooks, alerts and MCP go through an SSRF guard;
    • polling indicated by the provider only follows the configured host or the provider’s official domain;
    • sending email requires TLS.

    MCP · Alerts.

  • Guardrails: on input and output, by policy, with Azure AI Content Safety, Presidio, Lakera Guard and Bedrock Guardrails integrations and redaction of sensitive data (email, CPF, CNPJ, card numbers). Guardrails.

  • Bounded input: body size, concurrency and read deadline have caps, and the excess fails closed. HTTP input.

  • No code execution from the console: no administrator setting starts a program or loads a plugin on the server; a test in the release gate blocks any new path. Threat model.

  • Emergency stop: the operator cuts off all inference traffic at once (panic). Operations.

  • Identity and control mutations (teams, keys, providers, flags, policies) record the actor and the request_id, in an explorer with bounded export. ADR 0020.
  • request_id and traceparent are carried to providers, MCP, A2A agents and guardrails, and the journey can be reconstructed from any ID. Observability.

The gateway has no subprocessors of its own: it runs on the infrastructure of whoever installs it. It only talks to the external services the operator configures:

  • the model providers and the guardrail services;
  • the log destinations, the alert channels, the vaults and the IdP.

With the catalog flags on, it also downloads the public pricing and model catalogs (the community cost map, models.dev, OpenRouter, DeepInfra), without sending usage data. Automatic pricing.

  • release gate on every change:

    • Go with the race detector and vet;
    • tests against real PostgreSQL, Redis and Memcached;
    • more than 470 Playwright tests in the browser, under the real CSP;
    • semantic validation of the OpenAPI 3.1 document;
    • compatibility with the official OpenAI, Anthropic and Google SDKs.

    Quality.

  • Security scanning in the release gate (secure development): govulncheck, gosec, npm audit, gitleaks and trivy, with a CycloneDX SBOM generated by syft. Any finding fails the gate.

  • Signed release images, from the first public release (verifying a release image): each published image is signed keyless by the release workflow at its version tag, by digest, with the version and commit as signed annotations, and carries signed attestations of its CycloneDX SBOM (per platform) and of GitHub’s build provenance. The release candidates published before it are private and unsigned; identify them by digest.

  • Mutation testing on security and billing changes: a surviving mutant becomes a test case.

  • Real validation with ephemeral infrastructure (IdPs, vaults, buckets, providers), destroyed afterwards. Each ADR records what was exercised.

  • No external audit, certification or independent pentest. The security assessment is done by the team itself.
  • Stream output does not go through the guardrails.
  • Files, batches, vector stores, datasets and prompts are not encrypted by the application.
  • There is no per-end-user data deletion yet.
  • The administrative audit is not immutable and does not cover reads.
  • Rotating the master encryption key requires re-encrypting what was stored with it.
  • Cost estimates are advisory and are not equivalent to a reconciled invoice.

The full list by area is in the implementation matrix.

See the disclosure policy: the channel is GitHub’s Private vulnerability reporting once the repository is public; until then, report privately by e-mail to contact@m7gtw.com, without opening a public issue. High and critical flaws are fixed privately and published together with the advisory.

Secret-manager allowlist name validation keeps invalid private references out of its startup diagnostics. Safe parameter definitions describe bounds and defaults without disclosing allowlists, endpoints or credential references. See security and parameter definitions.

The optional runtime severity control permits global admin to change only info, warn or error, with CSRF, optimistic version and actor/request-ID audit. Global viewer can inspect; inference keys, operators and scoped roles cannot manage it. The control does not enable payload logging, change destinations/trust or disable error severity. Raising the minimum can suppress Info stdout/OTLP records; persisted audit, request history and trace export have separate controls. The applied threshold is reported only for an owned current controller, separately from the immutable startup capture. This is a product access boundary, not an external security certification.

The opt-in policy API accepts a closed four-field object under session/CSRF/role/version checks and validates the whole configuration before committing. Nonsecret key IDs are visible only through the dedicated global policy-read permission, never telemetry or the count-only boot inspector. Active sessions retain their captured policy and leases; changing admission policy does not revoke authorization or release financial reservations. Invalid stored state and database failures retain the last valid snapshot. See Realtime policy.

A generic runtime writer for YAML destination fields would allow exporting process secrets or cloud tokens to another endpoint. The implemented editor instead instantiates immutable operator-owned connection templates. Only IDs, batching, relative prefix and bounded service metadata are persisted; API responses omit raw credential references, profiles and URL userinfo/query/fragment. Both safe template labels and delivery receipts are sanitized without decoding escaped path delimiters into query or fragment syntax. No administrative permission silently grants a new environment lookup or workload-identity target. Existing six transports retain their explicit operator trust; no new cloud service or certification is implied. Policy and queues.

The opt-in boot policy persists only three HTTP input durations. Global rights, session/CSRF/version checks, closed payloads, complete candidate validation and actor/request-ID audit apply. It cannot rebind listener addresses, database connections, readiness targets, trust or credentials, and does not trigger a restart. Applied values are immutable and owned; unknown factories fail writes rather than claiming defaults. Per-instance source truth is preserved in the dedicated DTO and startup logs, while older inspectors report unavailable console-owned rows. Invalid startup policy fails before serving; runtime read failures keep the last valid observation.

m7gtwcontact@m7gtw.com