Skip to content
ShipSafeStack

Checklist

Is the Sentry DSN safe to expose?

Short answer. Yes. Sentry's DSN page says a Data Source Name is safe to keep public because it can only submit events. It cannot read your issues. The auth token used for source maps and the API is a different value, and that one is a secret. A public DSN can still be used to send junk events and burn quota.

Updated 24 Nov 2026

This is a practical checklist, not a guarantee. It is not a penetration test, a compliance audit, or proof that an app is safe to launch.

This page answers the question with the checks, not with a yes that covers every string named Sentry. The client DSN is the public one. SENTRY_AUTH_TOKEN is not. How to install the SDK is Add Sentry to a vibe-coded app. Sentry is the directory entry. If you are choosing a product, see Sentry vs LogRocket vs PostHog.

Sentry's pages below were read on 24 Nov 2026. Setting names move. If a step here disagrees with the page it links, follow that page.

What a DSN is

Sentry's DSN explainer says a DSN tells the SDK where to send events so they land in the right project. If you leave it empty, the SDK does not send anything.

The shape is:

{PROTOCOL}://{PUBLIC_KEY}@{HOST}{PATH}/{PROJECT_ID}

A current SaaS DSN looks like https://<32 hex chars>@o<org>.ingest.sentry.io/<project id>. The public key identifies the client key. The host is the ingest address. The last number is the project id. An older form could include a secret after the public key (public:secret@host). Sentry says that secret part is optional and deprecated, and that future versions will ignore it. Do not treat a modern DSN as if it still contained a secret.

Sentry's token formats page says DSNs are not secrets and should be left out of secret-scanning rules. A 32-character hex string inside that URL is the DSN public key. The same length is also a legacy API key, so a bare hex string with no URL is not automatically a DSN.

Putting the DSN in browser or mobile code, including a NEXT_PUBLIC_ or VITE_ variable, matches how the SDK is meant to run on the client. The same split for other keys is API keys in the frontend.

What is not a DSN

Auth tokens call the Sentry API. Sentry's auth tokens page says you use them to upload source maps, to run the CLI, and to call the API. They are not the DSN.

Sentry's token formats page names the prefixes:

PrefixWhat it isWhere it belongs
sntrys_Organization auth token. Bound to one org, meant for CI and the CLI. Permissions are fixed and limited.Build environment only. Shown once.
sntryu_Personal auth token. Bound to a user, and it can reach every org that user can reach.Your account. Not CI.
sntryc_ / sntryh_One-time CLI setup code, or a one-time agent handoff code. Sentry says each expires after five minutes.Treat as a credential until it expires.

A 64-character hex string with no prefix is a legacy token, an internal integration token, an OAuth secret, or a webhook signing secret. Sentry says those names often sit next to SENTRY_AUTH_TOKEN, authToken, or Authorization: Bearer.

Organization tokens are created under Settings, Developer Settings, Organization Tokens. Any member can create one. Only owners and managers can revoke one. Owners get an email when a new organization token is created. Personal tokens are under the account menu, Personal Tokens, and you can revoke your own.

The wizard writes the token to .env.sentry-build-plugin and gitignores that file. sentry-cli can also store it in ~/.sentryclirc. A sentry.properties file in the repo is the same class of secret if it contains a token. None of those belong in git, and none of them belong in a NEXT_PUBLIC_ or VITE_ name. The longer pass on generated code is how to keep API keys out of AI-generated code.

What a public DSN can still do

Sentry says abuse is uncommon, and that anyone who has the DSN can send events to that project with whatever content they want. That spends quota. It does not let them open your issues.

The controls Sentry documents:

  • Allowed Domains. Inbound filters say Sentry checks the Origin or Referer header against the project's allowed domain list. Requests from other origins are rejected and show up as Disallowed Domain in Stats. Requests with neither header are accepted anyway. That is normal for a server SDK and for someone posting straight to the ingest API. Allowed Domains do not stop that. Sentry says to use a project rate limit or a network allowlist for server-side ingestion.
  • Other inbound filters. Project Settings, Inbound Filters, can drop events by message, release, browser extension, and similar rules. Sentry says these filters run at ingest, and that filtered events do not count toward quota. They do not apply to every ingest path. The filtering page says a message filter does not apply to minidumps.
  • A rate limit on the client key. Manage your error quota says this is on Business and Enterprise plans. In Client Keys (DSN), open Configure. You can cap a key at so many events per minute. Events past the cap get a 429 and are dropped. Sentry says the limit should be a ceiling for a spike, not a limit you hit all day. One project can have a second key with no cap, for staging.
  • Spike Protection. Spike Protection drops events after a project crosses a threshold Sentry recalculates from recent volume. It covers errors, transactions or spans, and attachments. It does not run during a trial, because those quotas are unlimited. A Manager, Billing member, or Owner turns it on under Settings, Spike Protection. A spike that stays high becomes the new baseline, so the protection is for a short jump, not for a permanent flood.
  • Rotate the client key. The DSN page says you can rotate and revoke a DSN under the project's Client Keys (DSN) settings. The old DSN then stops accepting events. If the DSN is baked into an app people already installed, Sentry says to ship a new DSN without waiting on a store update when you can. They also say they cannot give a single recipe for that, because it depends on the app.
  • Block an IP. The DSN page says Sentry provides controls to block IPs. Use that for a source you can name. It is not a substitute for a rate limit.

Don't send secrets inside the event

A public DSN means the event body is the thing to watch. Sentry's server-side scrubbing page says scrubbing is on by default and should stay on. It removes values that look like card numbers, and values whose key or contents match names such as password, secret, api_key, token, and credentials. Organization Settings, Security & Privacy, overrides the project settings of the same name.

That match is on field names and on strings that contain those words. Sentry's SDK filtering page says beforeSend runs just before an error event is sent. Return the event to keep it, or null to drop it. Their example deletes event.user.email. Use that when a token or a raw body can still sit in a message after the denylist. A denylist will not catch a secret pasted into a free-text error. The SDK options, including sendDefaultPii and dataCollection, are in Add Sentry to a vibe-coded app.

If an auth token leaked

Treat sntrys_, sntryu_, or a 64-character hex token in a repo, a chat, or a client bundle as copied.

1. Revoke it. Organization tokens: Settings, Developer Settings, Organization Tokens. Only owners and managers can revoke those. Personal tokens: account menu, Personal Tokens. You can revoke your own. Sentry says to keep a separate token per job so one revoke does not stop every integration. 2. Create a replacement organization token for CI. It is shown once. Put it in the build environment as SENTRY_AUTH_TOKEN. Vercel and other hosts apply a new variable on the next deployment, not on the one already running. 3. Delete it from .env.sentry-build-plugin, .sentryclirc, sentry.properties, and any NEXT_PUBLIC_ or VITE_ name. Confirm .env.sentry-build-plugin is gitignored. Removing the line does not revoke the token. Rewriting history does not either. The same point for a GitHub credential is Leaked a GitHub token?.

A DSN in the client is not this incident. Do not rotate the DSN just because it is visible in the bundle.

Checklist

  • The value in the browser is a DSN (https:// … @ … sentry.io/ plus a project id), not sntrys_ or sntryu_.
  • SENTRY_AUTH_TOKEN is only on the build machine or in CI. It is not in a NEXT_PUBLIC_ or VITE_ variable, and it is not committed.
  • .env.sentry-build-plugin and .sentryclirc are not in the repository.
  • Allowed Domains lists the real site. You know that header-less requests still get in.
  • Scrubbing is still on. beforeSend drops emails or tokens the denylist will not see.
  • On Business or Enterprise, the client key has a rate ceiling. Spike Protection is on if a short flood would eat the month.
  • Then run a free passive check on the public URL. It can see a token that shipped in a script. It does not read your Sentry org. The worksheets are the checklist pack and the pre-launch checklist.

FAQ

Is the Sentry DSN safe to expose?

Yes, for the client DSN. Sentry says it only submits events and does not grant read access. It can still be used to send junk events. The auth token is the secret. Sentry's token formats page says to leave DSNs out of secret scanners so they are not flagged as leaks.

Does Allowed Domains stop someone who has my DSN?

Only for requests that send an Origin or Referer. Sentry says requests without either header are accepted even when an allowlist is set. A script on another website is blocked if the browser sends Origin. A server or a direct POST is not. Add a rate limit on the client key, or a network allowlist, for that path.

I committed SENTRY_AUTH_TOKEN. Is deleting the file enough?

No. Revoke the token in Sentry, create a new organization token, and put that only in CI. Deleting the file, or rewriting git history, does not revoke a token someone already copied. If it was in a NEXT_PUBLIC_ or VITE_ variable, it was also in the browser bundle.

Will Spike Protection save my quota if the DSN is public?

It drops events after a project crosses a threshold Sentry recalculates from the last week of volume, and it does not run during a trial. A flood that continues becomes the new normal. Sentry's own spike page says to also set a rate limit on the DSN key. That rate limit is documented for Business and Enterprise plans.

Sources

Checked 24 Nov 2026.

Informational only. This page describes checks and vendor documentation. It is not a security audit, a penetration test, or a certification, and it is not a guarantee.

Newsletter

A short weekly note on new tools and security checklists. No spam, unsubscribe anytime.