Reference
Privacy & redaction
Redaction happens on the device, before anything is written, with the same rules in every SDK (checked by shared conformance fixtures). It catches credentials. It does not catch personal data on its own; that part is your job.
Names, emails, addresses, order contents and other personal data that isn't a credential are not removed automatically. Add redactKeys, redactPatterns, beforeRecord/beforeCheckpoint hooks and exclude rules, then read real capsules with bugcapsule inspect --json before widening a rollout.
Built-in rules
| Where | Rule |
|---|---|
| By key name (bodies, storage, state, action payloads, checkpoints) | Names are normalized (lowercase; _ - . and spaces removed). Substring match: password, passwd, token, secret, apikey, authorization, cookie, cardnumber, creditcard, privatekey, sessionid. Exact match: pin, pan, otp, ssn, cvv, cvc, passcode, iban. Plus configured redactKeys and remote redactKeys. |
| Headers | authorization, cookie, set-cookie, proxy-authorization, x-api-key, x-auth-token, configured redactHeaders, and any header matching the key rules. Other header values are scrubbed as free text. |
| URLs (requests, routes, route checkpoints) | User info replaced. Query and fragment params matching the key rules or code, sig, key, auth, sid, session, *signature*, *credential* replaced. |
| Free text (failure messages, stacks, logs, labels, tracked text, text bodies, every string) | Bearer/basic tokens, JWTs, well-known API key formats, key=value / key: value / "key": "value" pairs with a sensitive key, Luhn-valid card numbers, configured redactPatterns. A string holding JSON is redacted as JSON. |
| Tracked text | Replaced whole when the id matches the key rules or the field is marked sensitive. Always for Android password input types (Views), iOS isSecureTextEntry, web type=password and data-bugcapsule-sensitive. |
The placeholder is [REDACTED]. Regex word boundaries are ASCII in every runtime. The rules used are recorded in manifest.redaction, and replay applies the same rules so request keys computed from redacted bodies still match.
What it doesn't find
- Secrets in URL path segments (
/reset/8f2c…). UsesanitizeLocationandexclude. - Personal data that isn't a credential.
- Secrets under innocuous key names that don't match a pattern.
- Binary bodies. In the current SDK releases they are recorded as size and content type only unless you opt in.
- State an integration chose not to describe (serializers decide what's captured).
Optional capsule screenshots
Flutter 0.4.2 and iOS 0.4.2 provide ScreenshotIntegration. Availability in other platforms depends on their separately published SDK releases. Install it with enabled: true and a captureRedactedPng provider, then call capture() at reviewed application checkpoints. It is off by default and never captures the desktop or renders from a crash handler. Existing frames can be included when a crash writes a capsule.
The application must render only approved content and mask sensitive pixels before returning PNG bytes. Return null/nil for sensitive screens. Password-field tracking, key redaction and regex patterns do not mask pixels; beforeRecord can still drop a screenshot event. Helpers encode an already masked canvas (Web), bitmap (Android) or image (iOS/Flutter). No generic automatic full-screen renderer is installed.
Hard limits are one attempt per second, 20 frames or 2 MiB per session, 256 KiB per frame and 2048 pixels per side. Limits can be lowered. Text metadata, EXIF and animated PNGs are rejected. Frames are diagnostic events in the ordinary capsule, compatible with spec v1 and v2, and share its permissions, retention, encryption and deletion. Deploy the updated backend and dashboard before enabling SDK capture.
The Timeline shows the last screenshot at or before the selected event and its age. Events can expand each image. These are recorded frames, not video or replay screenshots.
Controls by SDK
| Control | Flutter | Android | iOS | Web |
|---|---|---|---|---|
| Extra keys / headers / patterns | redactKeys, redactHeaders, redactPatterns in the config (Android: builder methods, redactPattern(regex)) | |||
| Edit or drop any event | beforeRecord(type, data): return null to drop | |||
| Edit checkpoint data | beforeCheckpoint(integration, data) | |||
| Exclude endpoints (keep method/URL/status/timing) | BugCapsuleDio(exclude:), BugCapsuleHttp(exclude:) | BugCapsuleOkHttp(exclude =) | BugCapsuleURLSession(exclude:) | networkIntegration({ exclude }) |
| Rewrite route locations | BugCapsuleGoRouter(sanitizeLocation:) | BugCapsuleNavigation(sanitizeLocation) | you call setRoute | historyIntegration({ sanitizeLocation }) |
| Storage allowlist | allowPrefixes / denyPrefixes (default: all keys) | allowFile, allow, deny (default: nothing) | keys, prefixes, denyPrefixes (default: nothing) | allowPrefixes required |
| State | serializers project the state you choose; recordStateData off in production by default | you write the serializer; only registered state is captured | ||
| Body capture off | captureNetworkBodies: false locally, or remotely (also strips bodies already buffered). Capsules become partial; request bodies ≤ 64 KiB are still hashed (never stored) for matching. In the current SDK releases, production mode records no bodies unless you set captureNetworkBodies: true (see below). | |||
| Everything off | Local enabled: false (no capture code runs) or the remote kill switch | |||
beforeRecord: (type, data) {
if (type == 'log' && '${data['message']}'.contains('@')) return null; // drop logs that mention an email
if (type == 'http' && data['responseBody'] is Map) {
(data['responseBody'] as Map).remove('shippingAddress');
}
return data;
},
Interaction payloads
Available in the stable releases (Flutter 0.4.2, Android 0.4.1, iOS 0.4.2 and web 0.4.0). Applies only when you add a WebSocket, platform channel or native SDK integration.
WebSocket frames, platform channel arguments and results, and native SDK values are recorded as payloads with a mode: full, redacted, metadata (size only), omitted or truncated.
- Redaction before persistence. Every payload goes through the same rules as bodies before anything is stored, and connection URLs are redacted like request URLs. A payload that redaction changed is recorded as
redactedand isn't replayed unless the integration opts in withredactedReplayable(only when the app doesn't branch on those fields). - Binary frames are sizes only by default. Keep them only by opting in (
captureBinary, or a serializer on web). Raw bytes are kept as they are, without redaction (as with web'srawBinarySerializer); values a web serializer decodes are redacted like text frames. Flutter'smetadataOnlyrecords a whole socket as sizes only, for example a chat. - Allowlisted channels only. Flutter records only the platform channels you list; framework channels are never recorded.
- Limits: 64 KiB per payload (larger: truncated), 1 MiB of interaction payloads per capsule window (later ones: size only), 32 active connections and subscriptions (more aren't captured).
- Per-adapter kill switch. Your project's capture settings can turn off one adapter by its id without touching HTTP capture; devices drop what that adapter buffered. Flutter also applies a lower interaction payload limit from there. See capture settings.
- Body capture off. In Flutter and Android, turning off network body capture (locally or remotely) records interaction payloads as
omitted. In the iOS and web SDKs it covers HTTP bodies only: turn off the adapter to stop recording frames.
The Flutter adapters (bundled in bug_capsule since 0.4.1-beta.12) keep secrets out by design:
- Stripe adapter (
BugCapsuleStripe) never records client secrets, ephemeral keys, customer session secrets, customer ids or payment method parameters (only the method type and which fields were set). Billing and shipping names, emails, phones and address lines become[REDACTED],last4becomes0000, fingerprints and bank codes are redacted, and replay hands the app a placeholder client secret. - Firebase Auth adapter (
BugCapsuleFirebaseAuth) never reads ID tokens, refresh tokens or credentials, so they are never recorded. Email, display name and phone number are recorded as synthetic values unless you passrecordProfile: true(redaction still applies). Firestore snapshots with fields that match the redaction rules aren't replayed unless the adapter is created withredactedReplayable: true.
Privacy defaults
Current release defaults. These defaults apply to Flutter 0.4.2, Android 0.4.1, iOS 0.4.2 and web 0.4.0. See What's new.
| Production mode | Debug / QA mode | |
|---|---|---|
| HTTP request and response bodies | off (method, URL, status, headers and timing are kept) | on (redacted) |
| Binary or non-UTF-8 bodies | size and content type only | size and content type only |
Android SQL in db.sql.query spans | literals replaced by ? | literals replaced by ? |
captureNetworkBodies: trueorfalseoverrides the mode either way. Your project's capture settings can turn bodies off but never on.- Opt in to binary bodies per integration: Flutter
maxBinaryBytesonBugCapsuleDio/BugCapsuleHttp, AndroidBugCapsuleOkHttp(captureBinaryBodies = true), iOScaptureBinaryBodies: true, webnetworkIntegration({ captureBinaryBodies: true }). Raw binary bodies are not redacted. - Capsules without bodies still replay with empty response bodies and a
network.noBodydivergence, and listnetwork.bodiesin eligibility. - Free-text redaction also removes every BugCapsule credential format: SDK tokens, CLI and service tokens, ingest and secret keys, patch and delivery tokens.
- Project settings can only narrow capture: they can remove trace propagation targets, never add them, and can't raise the capsule size limit above 50 MiB.
- Replay restores only the storage keys the capture's recorded policy allowed (
restore.disallowedfor the rest).
Consent and local data
Available in Flutter 0.4.2, Android 0.4.1 and web 0.4.0. The iOS SDK follows in a later release; on iOS, start the SDK only after consent and use enabled: false or the kill switch.
Start with collection off, turn it on from your consent screen, and erase what the SDK stored when a user asks:
BugCapsule.init(
config: const BugCapsuleConfig(token: 'bcsdk.v1.…', collectionEnabled: false),
appRunner: () => runApp(const MyApp()),
);
// From your consent and privacy screens:
await BugCapsule.setCollectionEnabled(true);
await BugCapsule.setCollectionEnabled(false);
await BugCapsule.clearLocalData();
BugCapsule.init(this, BugCapsuleConfig.builder().token(token).collectionEnabled(false).build())
// From your consent and privacy screens:
BugCapsule.setCollectionEnabled(true)
BugCapsule.clearLocalData()
await BugCapsule.init({ token: 'bcsdk.v1.…', collectionEnabled: false });
consentBanner.onAccept(() => BugCapsule.setCollectionEnabled(true));
privacySettings.onWithdraw(() => BugCapsule.setCollectionEnabled(false));
privacySettings.onErase(() => BugCapsule.clearLocalData());
setCollectionEnabled(false)stops recording and monitoring at once, uploads nothing more, and deletes queued capsules, queued events, saved captures and (Flutter) crash journals. An app started with collection off captures nothing and does not contact BugCapsule at all.setCollectionEnabled(true)takes effect at the next launch on Flutter and Android, because capture is set up before the app starts. On the web it starts capture right away if the page started with collection off; after a withdrawal in the same page session it waits for the next page load. Until then the status API says so.- The choice is stored on the device and wins over
collectionEnabledin the config, which is only the default for a device where no choice was made (defaulttrue). Web stores it inlocalStorage; if storage is blocked, it lasts for the page or process only. clearLocalData()deletes what the SDK stored on the device: queued and saved capsules, queued monitoring events, crash journals, the cached project settings and the monitoring install id and session, plus the in-memory buffer and breadcrumbs. Recording, if on, continues from a fresh start. It keeps the consent choice and the emergency policy cache, so feature guards keep working offline. On Android, callsetCollectionEnabled(false)first to drop the running session's recording too.- Both work before
init. Read the current choice withBugCapsule.collectionEnabled(web:collectionEnabled()). While collection is off, status reportsdisabledwith reasoncollection_disabled. - Saved captures (the 20 newest, for in-app QA tools) are deleted after 7 days. Flutter:
savedCaptureMaxAge; Android:savedCaptureMaxAgeMs. - Backups. Android keeps the SDK's files in
noBackupFilesDir/bugcapsule, outside Auto Backup. Files an older Flutter SDK left infiles/bugcapsulemove there on the first launch. Flutter on iOS: addbug_capsule_nativeto exclude the storage root from backups and set its file protection tocompleteUntilFirstUserAuthentication. Without it the root (Library/Application Support/bugcapsule) is backed up. - Native crash reports held by
bug_capsule_native's platform SDKs are not deleted by Flutter'sclearLocalData.
This covers data on the device. Data already uploaded to your project follows the retention and deletion rules below.
What's collected and where it goes
Capsule recording happens only when capture is enabled and the session is sampled (debug and QA always; production at most productionSampleRate, default 10%). A capsule is written only on a failure or a QA capture.
Not automatically collected as capsule data: screen recordings; screenshots require an explicitly enabled integration and a privacy-reviewed capture provider (see below), platform-channel traffic outside the channels you allowlist, location (unless you add a location adapter) or contacts. Values you explicitly put in state, logs, labels, feedback or monitoring context can still contain personal data. Monitoring adds error events, sessions, performance and feedback independently of capsule sampling; it can include an install identifier and user context you provide. See monitoring privacy and sampling.
| Where | Retention |
|---|---|
| Device memory | The session (discarded at exit or kill switch) |
| Device files | 20 newest saved captures (deleted after 7 days in Flutter, Android and web); outbox ≤ 10 capsules / 10 MiB / 7 days; deleted on kill switch, and on setCollectionEnabled(false) or clearLocalData() in Flutter, Android and web |
| Your BugCapsule project | Your project's retention period (30 days unless agreed otherwise), then deleted automatically |
| Share links | Until expiry (default 72 h, max 30 days), revocation or capsule deletion |
| Developer machines | Outside BugCapsule's control (pull, run, regression files) |
Deleting one capsule: delete it in the dashboard; it disappears with its runs and share links at once. One end user's data: Monitoring can include user identifiers supplied through setUser, feedback contact details and install identifiers. Review related events, sessions and feedback as well as capsules; deleting a capsule alone is not a complete end-user deletion workflow. Coordinate that request with your BugCapsule team, including local exports and regression fixtures. For anything else (retention, whole-project deletion, a data processing agreement) contact your BugCapsule team.
This describes the product, not a legal assessment. Whether it meets your obligations is for you and your counsel.
Keeping your keys safe
- The SDK token is public. Anyone can extract it from a shipped app, so it can upload capsules and monitoring envelopes and read SDK settings, nothing more. That's why it (or, in an existing setup, the ingest key) is the only credential that goes in an app. Revoke or rotate it in the dashboard if it is abused.
- The secret key is your project's admin key. Whoever holds it can read, share and delete your capsules and change capture settings. Keep it in the CLI config and CI secrets only, share it with as few people as possible, and rotate it in the dashboard when someone leaves. In the current SDK releases, an app configured with a secret key (
bcs_…) refuses it and runs without uploads. - Share links are public by design. Anyone with one can download that capsule until it expires or you revoke it.
Monitoring data needs its own review
Capsule sampling is not a global telemetry opt-out. Monitoring is enabled by default once the SDK is connected. Use the platform-specific monitoring switches and review beforeSend, breadcrumbs, feedback text and trace propagation as well as capsule redaction. Names and email addresses are not automatically removed just because they identify a person. Do not use production personal data as regression fixtures.
Monitoring has a separate bounded envelope outbox (default 30 envelopes / 5 MiB / 7 days). Confirm server retention separately for events, sessions, transactions and feedback. Do not assume the capsule retention setting governs every signal.