Security
You are handing us other people's keys. Here is exactly what happens to them.
Penstoke holds your OpenAI key, your R2 secret, your APNs .p8 and your Firebase service account, because a gateway cannot route a call without them. Every claim below is a description of code in this product, and the things we cannot claim are named too.
14 days, no card
What we hold on your behalf
Every one of these is encrypted at rest and is never returned to a browser after you save it.
- AI provider keys — OpenAI, Anthropic, Google Gemini, Groq, OpenRouter, or any OpenAI-compatible endpoint.
- Object storage secrets — the secret access key for Cloudflare R2, AWS S3, Google Cloud Storage, Supabase Storage, MinIO or Backblaze B2, and the Cloudinary API secret.
- Apple push keys — the APNs .p8 private key, per app or gateway-wide.
- Firebase credentials — a project's service account JSON, or the refresh token from signing in with Google.
- App analytics credentials — an App Store Connect team key, a Google Play service account, and the Google grants behind AdMob and Google Analytics.
- The webhook signing secret, so events we send you can be verified as ours.
What never arrives here
The shortest way to protect something is not to be holding it.
- Card details. Paddle is the merchant of record and takes the payment; card numbers never reach us.
- The bytes of your files. An upload gets a short-lived signed URL and goes straight from the client to your own bucket; what the gateway records is the object's key, size, content type and etag.
- A model of our own. Every AI call is forwarded to the provider you configured, on your account with them, under their terms — there is nothing here for your traffic to be routed into instead.
- Your password. What is stored is an argon2id hash, which the password cannot be recovered from.
- Any advertising or analytics tracker, on this site or in the dashboard.
Some secrets are encrypted and some are hashed, and the difference is not a detail.
One question decides it every time: does this secret have to be readable again? Answer it honestly and a gateway gets two different answers in the same system.
Encrypted — your provider credentials
Your OpenAI key, your R2 secret, your .p8 and your service account JSON have to be presented to the provider on every call we make for you. A hash is one-way by design, so a hashed provider key could never be handed to OpenAI — the product would not work at all.
So they are encrypted instead: reversible on purpose, with the key that reverses them kept out of the database. That is the honest trade, and it is why anyone telling you they hash your provider key is either not making the call for you or not describing what they do.
Hashed — everything we only check
Your password, your Penstoke API keys, your session cookie, every link and code we email you: nothing we do with any of them requires reading them back. The only operation is “is this the same value?”, and a digest answers that.
So we keep no recoverable copy. We cannot show you an API key a second time, we cannot tell you your password, and we cannot read a reset link out of the database — and neither could anybody who took it.
Credentials at rest
- AES-256-GCM, one IV per value
- Every credential is encrypted with AES-256 in GCM mode under a fresh 12-byte random initialisation vector, and stored as v1:<iv>:<ciphertext>. GCM is authenticated, so a row somebody has altered fails to decrypt rather than decrypting into something else.
- The key is not in the database
- The encryption key is derived from GATEWAY_MASTER_KEY, an environment variable of the deployment, and is held only in the running process's memory. A copy of the database on its own decrypts nothing.
- Never returned to a browser
- Once a credential is stored, no API response contains it again. The dashboard is told whether one is configured, and for a pasted key it is shown a hint — four dots and the last four characters — which is what lets you tell two keys apart without either of them travelling back over the wire.
- Decrypted only to make the call
- A credential is read back inside the request that needs it: the AI adapter about to call your provider, the S3 signer about to sign an upload, the APNs or FCM sender about to deliver a notification. It is never logged and never serialised into a response.
- Deleting it deletes it
- Removing a provider, an app or a connection removes the encrypted column with the row. Deleting an organization cascades to every one of them. There is no copy kept somewhere else to be forgotten about.
- A version marker, for the key we will one day change
- The v1 prefix on every stored value exists so that a second key can be introduced later without having to read and rewrite every row at once. There is no rotation schedule today, and the prefix is the honest size of the groundwork for one.
The secrets we only ever verify
Each of these is a random value we hand out once and then recognise by its digest. There is no version of any of them in the database that anybody — us included — can read.
- Passwords — argon2id
- Hashed with argon2id, a memory-hard function designed to make large-scale guessing expensive even with the hashes in hand. Signing in with an address that has no account is checked against a fixed hash anyway, so a wrong address takes the same time as a wrong password and reveals nothing.
- Gateway API keys — shown once
- A key is 32 random characters after its prefix. We store its SHA-256 digest and the prefix; the key itself is in exactly one HTTP response, to the person who created it, and is never retrievable afterwards. An authenticated call is matched by hashing what arrived and looking that up.
- Sessions — a digest, not the cookie
- The session cookie carries 32 random bytes. The database holds the SHA-256 digest of them beside the expiry, so a leaked row is not a usable session.
- Password reset links — one hour, one use
- 32 random bytes, stored only as a digest, dead an hour after it is sent and dead the moment it is used. Asking again kills the previous link rather than adding a second one, so an account never has two live ways in.
- Verification codes — keyed, and capped
- A six-digit code is only a million values, so a plain digest of one could be reversed by computing all million. It is stored as an HMAC under the deployment's master key, which is not in the database — and it tolerates five wrong answers before it is burned, lives fifteen minutes, and is the account's only live code.
- Invites — hashed with an expiry
- An invitation link is stored the same way as a reset link: a digest and an expiry date. Accepting it, or a password reset on the same account, retires it.
The keys you issue, and how small you can make them
Your applications never hold a provider credential. They hold a Penstoke key, which is the one you can scope, budget, rotate and revoke without touching anything you configured upstream.
- Scopes, checked on every call
- A gateway key carries some of storage, ai and push:send. Each request names the scope it needs and a key without it is refused — and a key can only be created with scopes whose dashboard permission the person creating it already holds, so nobody mints themselves more rights than their role has.
- One key per AI endpoint
- An AI endpoint has its own key, its own list of allowed models and its own monthly dollar budget. One application therefore cannot spend another's budget or reach a model it was not given, and revoking one endpoint leaves the rest working.
- Budgets that stop the call
- The budget is reserved before the request leaves for the provider and reconciled against the real cost afterwards, so concurrent requests cannot all pass the same check and overshoot a cap together. Over budget, the call is refused rather than invoiced.
- Rotate or revoke, per key
- Rotating issues a new secret and the old one stops working on that write. Revoking is immediate and idempotent, and a revoked key can only be deleted afterwards — its history stays in the log either way, so you can still see what it did.
- What the prefix is for
- A key reads gw_ai_live_… or gw_sk_live_…, and we keep that prefix plus the first few random characters in clear. It is how a key in a screenshot, a stack trace or a commit can be identified and revoked without anyone having to produce the whole secret to find out which one it was.
- Client keys cannot send
- A push app's key ships inside a mobile or web app, so it is treated as public: it can register a device and report an open, and nothing else. Sending a notification needs a server key with push:send, which never leaves your servers. An app's key is rotated rather than revoked — a new one is issued and the old stops working on that write — and pausing the app stops it authenticating at all. An optional IP allowlist narrows key traffic further, checked against the connecting address rather than a header a caller could write.
One organization’s data is kept from another in the data layer, not in each query.
A filter every query has to remember is a filter that gets forgotten at one call site out of hundreds, and the result of forgetting it is somebody else’s rows. So it is not where the rule lives.
- Scoped in the data layer
- Every model that belongs to an organization is listed in one place, and a database client extension adds the organization to the filter of every read and to the data of every write against those models. It is not a condition each query remembers to include.
- Unscoped is a crash, not a wide read
- If a query against one of those models runs with no organization in context, it throws. The failure mode of a forgotten scope is an error in our logs, rather than another customer's rows in your response.
- The raw escape hatches are closed
- MongoDB's raw query and aggregation operations carry a filter the extension cannot read or narrow, so they are refused outright inside an organization's context.
- Crossing organizations is a short list
- The few jobs that legitimately span customers — the dispatch loop, usage rollups, resolving which organization an API key belongs to — have to say so explicitly and record why, which is what keeps that list short and reviewable.
- Cached answers never cross
- The AI response cache keys on the calling endpoint as well as the prompt. Without that, one key holder could confirm that another had sent an exact prompt — and be handed their answer — simply by replaying it.
- Our own console is deliberately thin
- The operator console is the one place tenant scoping is off, and it answers to a flag on the person rather than to a role in your organization. What it reads is organizations, their plan, their seats and counts of what they have configured. It reads no request log and decrypts no credential.
Sessions
- An httpOnly cookie
- gw_session is httpOnly, SameSite=Lax and Secure in production, so no script on any page can read it. It is the only cookie the dashboard sets and there are no advertising or analytics cookies beside it.
- A row on the server
- A session is a database row — user, organization, expiry, the address and browser it started from — not a self-contained token. It expires after seven days by default, and because every request looks the row up, revoking it takes effect on the next request rather than whenever a token would have expired. A password reset is how you end them all at once.
- A reset ends every session
- Resetting a password revokes every session that account had, including the one that asked. It also does not sign you back in: you prove the new password on the sign-in form. A reset is usually somebody recovering from a compromise, and leaving the intruder's session alive would waste it.
- Losing a seat ends access
- The role comes from your membership of the organization, read on every request rather than baked into the session. Removing somebody, or suspending an organization, takes effect on their next request without anyone having to hunt down their sessions.
- A note when a new device signs in
- A sign-in from a browser and network this account has not been used from before is emailed to the account's address, naming the browser, the address and the time. It does not guess a city: there is no geo-IP lookup here, and inventing a location would be the one line in the message you could prove wrong.
- Cross-origin writes are refused
- A state-changing request authenticated by the session cookie is rejected unless its origin is one of the dashboard's own. Key-authenticated gateway routes are open to any origin on purpose — they carry no cookie, so there is nothing for another site to ride on.
What happens when something is wrong
Two different jobs: making an attack expensive while it is happening, and being able to answer afterwards what actually occurred.
- Sign-in is rationed twice
- Sixty attempts a minute from one address, and ten a minute against any one email. Two limits because they stop two different attacks: one host working through a password list, and a distributed attempt on a single account.
- So is everything emailed
- A reset can be asked for ten times a minute from one address and three times a minute for any one email, and underneath that the database allows one reset mail per address per minute, so the limit survives a restart. Verification codes allow three sends and ten checks a minute, above the five-guess cap on the code itself.
- And so is every key
- Each gateway key is held to a per-second ceiling you set, under the ceiling your plan allows, and an AI endpoint additionally enforces its own requests-per-minute. A refused call answers 429 with the seconds to wait.
- The audit log
- Who did what, when, from which address and with which browser: sign-ins, sign-ups, invitations accepted, password changes and resets, address verification, and every credential, routing rule and send. The actor's name is stored alongside the reference, so a log still reads correctly after the person who made the entry is deleted.
- The request log
- Every call through the AI gateway records which endpoint and key made it, the model asked for, the provider and model that answered, tokens, cost, latency, status, whether a fallback or the cache was used, and the calling address. That is the record a surprise bill or a misrouted alias is diagnosed from.
- Prompt previews are a switch you own
- The request log can also keep the first 500 characters of the prompt and of the answer, which is what makes a bad response reproducible. It is a per-organization setting under Settings → AI, on by default; turn it off and nothing further is written. Either way those rows belong to your organization and only a seat in it can read them.
What we do not claim
This is the half of a security page that usually goes missing. Everything above describes code that exists; everything here is something a reader might reasonably expect and will not find.
- No SOC 2 and no ISO 27001
- Neither is held, neither is in progress, and claiming either would be a lie a reviewer can check in an afternoon. What is on this page is the whole of what is implemented, which is the thing an audit would have been evidence about.
- No third-party penetration test, and no bug bounty
- Nobody external has been paid to attack this, and there is no reward programme. What there is: the mailbox below, answered by the person who wrote the code, and a stated preference for hearing about a problem before the internet does.
- No two-factor authentication yet
- There is no TOTP or passkey on Penstoke's own sign-in. Standing in for it: argon2id hashing, the sign-in rate limits, an email the first time your account is used from a new device, sessions that are server-side rows a password reset can end all at once, and a per-organization IP allowlist for key-authenticated traffic. If your threat model needs a second factor, this is the gap to weigh.
- No key rotation schedule
- The master key encrypting credentials is set once per deployment. Stored values carry a version prefix so a second key can be introduced without rewriting every row, but no rotation has been performed and no schedule exists.
- No hardware security module
- The master key is an environment variable read by the process, not a key held in an HSM or a cloud KMS that signs without releasing it. It is outside the database, which is the property that matters most, and it is not outside the host.
- No 24/7 staffed monitoring
- This is a one-person operation in the United Kingdom, not a follow-the-sun rota. A provider going dark raises an alert and the gateway fails over to the next provider on its own; a message about it is usually answered within a working day.
Found something? Tell us before you tell the internet.
Email support@penstoke.com and say in the subject line that it is security, so it is read as that rather than as support.
- What to include
- What you did, what happened, and what you expected instead. A request id from the X-Request-Id header, or a log id from the dashboard, finds the request itself rather than a description of it.
- What we do
- Read it, usually within a working day, and tell you what we found — including when we decide not to change anything, and why.
- What we ask
- A reasonable chance to fix it before it is published, and that you test against your own organization rather than somebody else’s data. There is no reward programme to claim; there is credit if you want it.
- Not a security report?
- The same mailbox takes support, billing and data requests — see contact. What the privacy policy adds to this page is who holds the data, for how long, and your rights over it.
Security questions
- Is my OpenAI key safe with Penstoke?
- It is encrypted with AES-256-GCM before it is written down, under a key derived from an environment variable of the deployment rather than anything stored in the database — so a copy of the database alone decrypts nothing. After you save it, no API response ever contains it again: the dashboard sees only that a key is configured and a hint of its last four characters. It is decrypted in memory inside the request that calls OpenAI, and it is never written to a log. What it is not is protected by a certification or a third-party audit, because Penstoke holds neither; the whole of what is implemented is written out on this page so you can judge it yourself.
- Do you read my prompts?
- The record every call writes is about the call rather than its content: which endpoint and key, the model asked for, the provider and model that answered, tokens, cost, latency, status, whether a fallback or the cache was used. The request log can additionally keep the first 500 characters of the prompt and of the answer, because that is what makes a bad response reproducible — it is a per-organization setting under Settings → AI, on by default, and turning it off stops anything further being written. Those rows belong to your organization and only a seat in your organization can read them. Penstoke's own operator console reads no request log at all. Uploaded files are not held either: they go straight from your client to your own bucket under a signed URL, and what is recorded is the object's key, size, content type and etag.
- Why is my provider key encrypted and not hashed?
- Because a hash is one-way, and the gateway has to present your key to OpenAI, to R2 or to APNs on every single call. A hash cannot be turned back into a key, so a hashed provider credential would make the product impossible — anyone claiming to hash yours either cannot make the call for you or is not describing what they actually do. What hashing is right for is a secret we only ever need to check: your password, a Penstoke API key, a session cookie, a link we emailed. Nothing we do with those requires reading them back, so we keep a digest and compare. Both choices follow from the same question — does this secret have to be readable again? — and answering it honestly gives two different answers in one system.
- What would somebody get from a copy of your database?
- Not your provider credentials: those are encrypted and the key is not in there. Not any password, API key, session cookie, reset link or invite link: those are stored as digests of random values large enough that they cannot be reversed or tabulated. Not a verification code either, because the six-digit codes are stored as an HMAC under the same key that is not in the database. What is in there in clear is your configuration — provider and bucket names, routing rules, app identifiers, member email addresses — your audit trail, and your request records, including the prompt and response previews if your organization has those switched on.
- What happens if one of my gateway keys leaks?
- Revoke it in the dashboard and it stops authenticating immediately, or rotate it to get a new secret while the integration keeps its name and settings. The damage it could do before you noticed is bounded by what you gave it: a key carries only the scopes it was created with, an AI endpoint key is limited to its own allowed models and its own monthly dollar budget, a push app key can register a device but never send a notification, and an IP allowlist can narrow key traffic to addresses you name. Because every key keeps a readable prefix, a key you find in a log or a commit can be matched to the one in your dashboard without anyone having to hand the whole secret around, and the request log shows what it did while it was live.
- Are you SOC 2 certified?
- No. Penstoke holds no SOC 2 report and no ISO 27001 certificate, neither is in progress, and there has been no third-party penetration test or bug bounty. It is a small operation and it would rather be checkable than certified: this page states exactly what is implemented — AES-256-GCM for credentials under a key held outside the database, argon2id for passwords, hashed single-use emailed links, organization scoping enforced in the data layer, an audit log and a request log — along with what is absent, including two-factor authentication on our own sign-in. If a procurement process requires a report, Penstoke will fail that requirement today, and saying so is more useful than a page that implies otherwise.
Keep your provider keys in one place, behind keys you can revoke.
Start free trial14 days, no card. Or send one call through the playground first, where a key lives in the page’s memory only — never in storage, never in the URL. Penstoke’s privacy policy says who holds what, and for how long.