Security
No body value reaches
the server unless you keep it
Stubsmith turns real API traffic into deterministic integration tests. Masking happens at the edge, inside your infrastructure, before any data is transmitted. Of the values in a request or response body, only the fields you reviewed and gave a keep rule reach our servers in the clear, and by default there are none. This page explains how that works in practice, and where the edges of it are.
Edge-only masking
Samples are masked at the SDK, inside your infrastructure, before any network call is made. The Stubsmith ingest endpoint receives masked bodies and field names. A raw body value from your users crosses your network boundary only for a scalar field you reviewed and gave an explicit keep rule, and by default no field has one.
This is the fundamental privacy guarantee: we never see a body value you have not explicitly kept, by construction. It is not a firewall policy, an RBAC rule, or a contractual promise: the server receives only masked payloads, in which every value not covered by a keep rule you approved has been replaced before leaving your process.
The honest edge of that guarantee is the URL. The SDK normalises a path into a template and masks every query value you have not kept, so /v1/charges/90421?token=abc leaves as /v1/charges/{id}?token=<masked>. What it cannot do is recognise an identifier it has no rule for: a segment that is not all digits, UUID-shaped, or 16 or more hex characters, while automatic ID grouping is on (the default), is sent as written unless a path pattern you set in the dashboard collapses it. An endpoint shaped like /users/ana@example.com therefore puts an address in front of us. Stubsmith does not scan incoming captures for personal information. Masking happens in your process before anything is sent, and a server-side scan could only ever recognise an arbitrary subset of formats, so nothing on our side catches this shape of mistake at ingest. Setting a path pattern fixes the endpoint and removes the values already stored from our database; backups keep them until they expire, after 3 days. How URL paths work.
The SDK applies your masking rules fail-closed: every value is hidden unless a keep rule explicitly permits it. By default a string becomes <masked>, a number becomes 0 and a boolean becomes false. Set STUBSMITH_MASK_SALT and masked values keep their shape instead: a UUID stays a parseable UUID, a timestamp stays ISO 8601, an amount stays a non-zero decimal, each derived from the real value so equal values still match and different ones still differ. A new field in an API response is masked automatically until you configure a rule for it.
What crosses the boundary
Three things leave your infrastructure and reach Stubsmith's ingest endpoint:
- Masked sample bodies: the request/response body after masking rules have run. Values have been replaced with placeholders of the same type. The
amountfield is0, or a non-zero decimal once format-preserving placeholders are enabled. Thereceipt_emailfield is<masked>, or a synthetic address on your placeholder domain. Thebilling_namefield is<masked>either way: there is no name-shaped placeholder, so the most it can become is a synthetic token. Structure and key names are preserved; content is gone. - Structural fingerprints: each fingerprint’s identity is the request method and path template, keyed to a blake2b-64 digest over the sorted key-paths, query-parameter names, and content type. By default no values enter the digest; a variant key you opt in adds that value’s hash. A variant key must be a field you keep, so its value is visible in Review. Fingerprints are how Stubsmith deduplicates traffic and organizes stubs. Your endpoint names, HTTP methods, and path templates are visible; response schema shapes are recorded alongside fingerprints but are not digest inputs; no body value you did not keep is visible.
- Call metadata: the method, the domain, the templated path with its query values masked, the response status, and how long the call took. Transport headers travel with it:
content-type,content-length,accept,accept-encoding,hostandtransfer-encodingare sent as your client set them, because a stub that does not know the content type cannot be replayed. Every other header value,user-agent,cache-controlandaccept-languageincluded, is masked unless you gave that header a keep rule.
Field and path names are visible to Stubsmith. If your API path structure encodes sensitive information (for example, /users/{email}/profile), that structure is visible in fingerprints. Body values are not, and a query value is masked unless you kept it. A path segment is the exception: the SDK collapses it only when it is all digits, UUID-shaped, or 16 or more hex characters, or when a path pattern you set matches, so give any endpoint that carries an identifier or an address in its path a pattern.
Names are structure, and they are sent as they are: JSON keys, form field names, query-parameter names and header names. In a form body, whatever stands before each = is a name, so free text such as Hi Bob, ref=123 sends Hi Bob, ref as a name. Values are a different matter: the six transport header values above and any path segment the SDK does not recognise as an ID are sent as they are; every other value is masked unless you kept it.
Review and approval in the Stubsmith app operates on field names and paths, not on real values from your users.
EU-sovereign infrastructure
Every system that handles your captures, stubs, and account data runs in the European Union. Email is the one exception and is hosted in Switzerland, a country the European Commission recognises as providing an adequate level of data protection. No data transits to or is processed by US-headquartered cloud providers.
Compute: UpCloud, Amsterdam
The API, ingest, and web services run on UpCloud infrastructure in the nl-ams (Amsterdam) region. UpCloud is a Finnish company; infrastructure stays in the EU.
Object storage: Scaleway, Amsterdam
Masked sample bodies are stored in Scaleway object storage in the nl-ams (Amsterdam) region. Scaleway is a French company; data stays in the EU.
Transactional email: Scaleway, Paris
Account and security notifications (email confirmation, password reset and password-change notices) are sent through Scaleway Transactional Email in the fr-par (Paris) region. Scaleway is a French company; data stays in the EU. Only the recipient address and the message itself are involved: no captures, stubs, or sample data are ever included in an email.
Email: Infomaniak, Switzerland
Email for stubsmith.dev is hosted by Infomaniak, a Swiss company, in its own datacentres in Geneva and the canton of Vaud. Switzerland holds an EU adequacy decision, so no additional transfer safeguards are required. Correspondence only: no captures, stubs, or sample data ever reach a mailbox.
DNS and CDN: Bunny.net
DNS is operated by Bunny.net, a Slovenian company. Bunny.net also serves the public static surfaces via CDN: the marketing site (stubsmith.dev), the documentation site (docs.stubsmith.dev), and dashboard static assets (static.stubsmith.dev). Bunny.net terminates TLS for those public surfaces. The dashboard application (app.stubsmith.dev), the API, and the ingest endpoint (ingest.stubsmith.dev) are not behind the CDN: their TLS is terminated in Amsterdam with Let's Encrypt certificates, so authenticated traffic, API requests, and captured payloads never pass through the CDN. We deliberately avoided Cloudflare (US, subject to the CLOUD Act); Bunny.net is EU-based.
Database: UpCloud Managed PostgreSQL
Customer data is stored in UpCloud Managed PostgreSQL in the nl-ams (Amsterdam) region. The database has no public endpoint and is reachable only over a private network.
Sovereignty footnote: the .dev TLD registry is operated by Google. This is a paper-level dependency; the registry sees domain registration metadata, not user data or traffic.
Fail-closed fingerprints
A fingerprint is one unique traffic shape on one endpoint. Its key is the request method and path template plus a blake2b-64 digest over the request’s sorted key-paths, query-parameter names and content type. By default no values enter the digest; a variant key you opt in adds that value’s hash. A variant key must be a field you keep, so its value is visible in Review. Two cases still send a variant key’s hash for a value that is not stored: a new request shape on that endpoint, before you review it, and a value a project regex mask replaces. How variant keys work.
Fingerprints are capped per plan. When the cap is reached, new shapes are not stored, and the ingest endpoint answers HTTP 200 with {"ok":false,"error":"fingerprint_limit_reached"}. The Python SDK (0.7.0 and later) reads that answer and logs a warning on the stubsmith logger, once per error code per process, naming the limit and what to do. Older SDK versions ignore the response body, so with those nothing in your test run signals the cap. The Billing page shows a notice as soon as the cap is reached. The cap is enforced at ingestion time, not retroactively. Existing fingerprints and their stubs are never deleted.
Fingerprints are your durable asset. Samples (masked sample bodies) are kept as a rolling window per response variant, sized by your plan: the newest are retained and older ones are deleted as new samples arrive. The window is a count rather than an age, so an endpoint that fires rarely keeps its samples for as long as the fingerprint exists. Fingerprints, request types, and generated stubs persist indefinitely.
Tenant isolation baseline
The following controls are standard requirements for any multi-tenant system. They are listed for completeness, not offered as differentiators.
- Fail-closed RLS
- The runtime database role cannot bypass row-level security, and the policies are forced, so the schema owner does not escape them either. Every tenant query carries an organisation context; without a valid one a query returns zero rows rather than another tenant's data.
- Transaction-scoped context
- That context is local to the transaction and clears when the transaction ends, so it cannot survive into another request.
- Encryption in transit
- Every public endpoint is HTTPS only. TLS for the dashboard, the API and the ingest endpoint is terminated in Amsterdam with Let's Encrypt certificates; the public static surfaces are served over TLS by Bunny.net.
- Database encryption at rest
- The database runs on UpCloud Managed PostgreSQL, which encrypts its volumes at rest with a per-instance key and encrypts its backups separately, stored off site. This protects the database; it is not what protects your users' data, which is masked before it ever reaches us.
- App-level filters
- Application queries filter by organisation in their own right. The application-level check is the primary filter and row-level security is the database-enforced backstop, so a missed filter is a bug rather than a disclosure.
Security FAQ
- Does Stubsmith see my API request/response bodies?
- Not unless you ask us to. The SDK masks every request and response body fail-closed: values are replaced with typed placeholders before anything leaves your infrastructure. Stubsmith receives masked bodies and field names. The only values that arrive in the clear are those on scalars you reviewed and gave a keep rule, and by default there are none. Two things sit outside that rule: a path segment the SDK cannot recognise as an identifier, and the transport headers a stub needs in order to be replayed. Everything else our staff cannot see, because it never left your process. That does not depend on a policy on our side. It does depend on the keep rules your SDK syncs from your project.
- What exactly does Stubsmith receive?
- Masked sample bodies, where every value has been replaced by a placeholder of the same type (strings become <masked>, numbers become 0, booleans become false). Structural fingerprints for the request and the response: key-paths, header names, query-parameter names, and the types observed at each path. And the call metadata needed to file a capture: the method, the domain, the templated path, the status code, and how long the call took. A value reaches our servers in the clear only in three cases. One: you reviewed a scalar and gave it a keep rule, which can sit on a body field, a query parameter, or a header. Two: a path segment that neither the SDK heuristic (all digits, UUID-shaped, or 16 or more hex characters) nor a path pattern you set collapses (automatic grouping can be turned off per project), which is sent as written, so an endpoint like /users/ana@example.com puts an address in front of us. Nothing on our side catches that: ingest does not scan captures for personal information, because a server-side scan could only ever recognise an arbitrary subset of formats. Setting a path pattern is the fix; it also removes the values already stored. Three: the transport headers content-type, content-length, accept, accept-encoding, host and transfer-encoding, which a stub needs in order to be replayed. Every other header value, user-agent and cache-control included, and every query value you have not kept, is masked.
- What happens to my data when I cancel?
- Cancelling a subscription deletes nothing. Your plan stays active until the end of the period you paid for, then the workspace reverts to Free and its limits: existing fingerprints keep capturing, but no new fingerprint is recorded while you are over the Free cap, and each response variant keeps the smaller Free window of samples as new ones arrive. Deleting is a separate, deliberate act. Delete samples, fingerprints, or stubs from the dashboard, or delete the whole workspace, which takes your password and the workspace name typed back. Workspace deletion ends everyone's access at once; the data itself is held for 30 days so a deletion made in error can be reversed by contacting support, and after that it is erased from the database and from object storage and cannot be recovered by us or by you.
- How does PostgreSQL RLS protect my data?
- Every tenant query runs inside a transaction carrying an organisation context, and the row-level security policies are written against it: without a valid context a query returns zero rows rather than another tenant's. The runtime database role cannot bypass those policies, and the policies are forced, so the schema owner does not escape them either. Fail-closed by design.
- Is my data encrypted?
- In transit, yes, everywhere: every public endpoint is HTTPS only, and both SDKs refuse a plaintext
httpbackend URL, except on localhost. The database is UpCloud Managed PostgreSQL, which encrypts its volumes at rest and encrypts its backups separately, off site. For sample bodies the stronger property is that there is nothing to decrypt: values are replaced at the SDK, so what is stored is masked structure, not content. The exception is a field you reviewed and gave a keep rule, which is stored as it was sent. - Where does my data physically reside?
- Compute runs on UpCloud infrastructure in Amsterdam (nl-ams); the database is UpCloud Managed PostgreSQL in the same region. UpCloud is a Finnish company. Object storage is on Scaleway in Amsterdam, and transactional email is sent through Scaleway in Paris (Scaleway is a French company). DNS is operated by Bunny.net in Slovenia; Bunny.net also serves the public static surfaces (marketing site, documentation, dashboard static assets) via CDN, though the dashboard application, API, and ingest endpoint are not behind the CDN. Email is hosted by Infomaniak in Switzerland, which holds an EU adequacy decision. No data is processed by US-headquartered hyperscalers.
- Can I verify the security architecture independently?
- The SDK is open source and the masking path is auditable. The anonymizer rule format and the fingerprint schema are public. The strongest check is the one you can run yourself: point the SDK at your own traffic and read what it posts, because the masking happens in your process, not ours.
Integration tests from real API behavior
Start with the free plan. No card required.