Skip to content
Detectors

Scanner deep dive

Overview

Baseten is a platform for deploying and serving machine learning models. Baseten API keys grant access to model inference and the management API for a user or workspace.
From the detector’s Description() in source
Provider and detector details

Summary

ProviderNo provider details added yet.

Runs on any connection. Triggered by keywords in the content, after decoding.How TruffleHog works

How detection works

The v1 detector checks decoded text containing “baseten” for a possible credential.

Matching rules and source
Detector-wide rules and behavior
Prefix regex
One value
Guards against false matches
Not found in source
Not found in source
  • rotation_guide
  • version

How it behaves

What this detector does at each step of the TruffleHog pipeline.

pkg/detectors/baseten/v1 · Scanner

Keywords

Any one of these in the decoded text wakes the detector.

  • baseten

baseten.go line 44 (opens TruffleHog source on GitHub)

Behavior

Multi-part
No
Match window
512 bytes on each side of a keyword
ahocorasickcore.go line 159 (opens TruffleHog source on GitHub)
Custom endpoints
No
Cloud endpoint
None
Randomness check
None in this detector's own code
False-positive check
The shared word lists
Enabled by default
Yes in the open-source CLI, which turns on its feature flag
defaults.go line 1008 (opens TruffleHog source on GitHub)

Verification. When a scan allows it, TruffleHog tests a match by calling the provider. A scan can turn this off for every detector or for this one. Atlas only describes this; it never tests credentials. How the verify decision works

Analyzer.Baseten Analyzer

In short

  • v1: Wakes on “baseten” and tests matches with the provider. The open-source CLI runs it by turning on its feature flag.
  • v2: Wakes on “b10_” and tests matches with the provider. The open-source CLI runs it by turning on its feature flag.

How verification works

Each variant checks a found key its own way. Compare their requests and how answers are judged below.

The detection and verification evidence on this page comes from the Open Source implementation. Check the Enterprise coverage guide for product availability.

Does checking a key change anything at the provider?

Not expected to: it’s a GET request, which reads without changing anything, and the source declares no changes.

Source says: GET as declared in source; mutating side effects not declared

Files
v1/baseten.go
Request
GEThttps://api.baseten.co/v1/users/mebaseten.go:88 (opens TruffleHog source on GitHub)
Key is sent as
Authorization headerbaseten.go:92 (opens TruffleHog source on GitHub)
How answers are judged
Troubleshoot this check

If a result looks wrong, work through these steps. They’re built from the request and status rules above. The Atlas doesn’t send anything.

1. Send the same request yourself

Each variant checks keys its own way. Use the one that matches your key’s format (see Detection above).

  • v1

    curl -i -H "Authorization: $AUTHORIZATION_VALUE" "https://api.baseten.co/v1/users/me"
    • $AUTHORIZATION_VALUE: the full Authorization header value (its format depends on the provider)

    Rule: header. Key placement as recorded: Authorization header.

  • v2

    curl -i -H "Authorization: $AUTHORIZATION_VALUE" "https://api.baseten.co/v1/users/me"
    • $AUTHORIZATION_VALUE: the full Authorization header value (its format depends on the provider)

    Rule: header. Key placement as recorded: Authorization header.

Only test keys you own or are allowed to check. Each command is one read-only GET request, the same one TruffleHog makes. Compare the status you get with “How responses are judged” above.

2. Likely causes

  • The scanner couldn't reach the provider. The scanner needs outbound HTTPS access to api.baseten.co. A firewall, proxy or DNS problem is reported as an error, not a rejection, and the key can be checked again.
  • The provider rejected the key. TruffleHog counts these as not verified (v1: 401; v2: 401): usually a revoked, expired or mistyped key.
  • Rate limit or provider problem. TruffleHog counts these as an error, not a rejection (v1: any other status; v2: any other status). A rate limit (429) or an outage lands here; the key can be checked again later.
  • The provider changed its API. If the provider answers differently from the table above, its API may have changed since this check was written. Compare against the provider's docs.

3. Check the provider’s docs

4. Still stuck

Report it to TruffleHog

Include the status code and response you got. Never include the key.

Errors, timeouts and rate limits
Not found in source
Not found in source
SetVerificationError; unexpected HTTP response status %d

HTTP 200 or 403 is verified. Forbidden means the key authenticated but this endpoint refused the action.

other statuses: verification error or unknown

transport errors return a verification error

All URLs found in source

  • https://docs.baseten.co/organization/api-keys#api-key-format
  • https://docs.baseten.co/reference/management-api/api-keys/delete-an-api-key
  • https://docs.baseten.co/reference/management-api/overview
  • https://api.baseten.co/v1/users/me
Provider response documentation

Verified findings

Open Source · Standard output (stdout)

The CLI prints verified findings to stdout. Use --json for structured output.

Example scan output · credential redacted

✅ Found verified result 🐷🔑
Detector Type: Baseten
Decoder Type: PLAIN
Raw result: [redacted]
Terminal printer source
CI formats

With --github-actions, GitHub Actions displays this workflow command as a warning on the indicated file and line.

::warning file=config/example.env,line=8,endLine=8::Found verified Baseten result 🐷🔑
GitHub Actions printer source

Legacy compatibility. --json-legacy writes pre-v3 JSON for Git, GitLab, and GitHub sources only.

Enterprise alerts

When Enterprise verifies that a secret is live, a configured notifier can alert your team. The finding is also available through the Enterprise API.

Optional analysis

What the analyzer checks

In Open Source, run trufflehog analyze separately from the scan. Enterprise runs enabled self-discovery analyzers on first discovery of a supported live secret.

pkg/analyzer/cli.go registers this detector key to the analyzer package.

How it works

  1. Runs after the detector reports the match as verified.
  2. Evaluates what the credential may be able to access using the analyzer’s own checks or rules.
  3. Reports what it finds. Its source lists 5 permissions in 1 group.

Rotation resources

Use the provider’s instructions for this credential.

Rotation and revocation instructions

Baseten explains how to replace a personal, team, or API key management key: create a replacement, test it, then revoke the original by its prefix. For a leaked key, revoke it first, then create a replacement and check the audit log. The same steps cover keys with and without the b10_ prefix.

Provider documentation checked by Atlas on .

See it in the rotation directory

Token types

TruffleHog’s source looks for 1 token type, by prefix. It doesn’t name them.

Token types: from TruffleHog’s source, and what the vendor says
PrefixVariant
b10_v2
Pages TruffleHog’s source links to (3)

Coverage in other scanners

No confirmed matches in the available catalogs.

  • BetterleaksNo confirmed match
  • GitHub Secret ProtectionNo confirmed match
  • GitleaksNo confirmed match
  • KingfisherNo confirmed match

Changes

1 recorded change since Sep 18, 2026; 1 still needs review.

  1. What this change means

    Atlas added baseten to its detector catalog in this update.

    pkg/detectors/baseten/v1/baseten.go+137−0View file
    @@ -0,0 +1,137 @@
    1added: package baseten
    2added:
    3added: import (
    4added: "context"
    5added: "encoding/json"
    6added: "fmt"
    7added: "io"
    8added: "maps"
    9added: "net/http"
    10added:
    11added: regexp "github.com/wasilibs/go-re2"
    12added:
    13added: "github.com/trufflesecurity/trufflehog/v3/pkg/common"
    14added: "github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
    15added: "github.com/trufflesecurity/trufflehog/v3/pkg/pb/detector_typepb"
    16added: )
    17added:
    18added: type Scanner struct {
    19added: client *http.Client
    20added: }
    21added:
    22added: // Ensure the Scanner satisfies the interface at compile time.
    23added: var _ detectors.Detector = (*Scanner)(nil)
    24added: var _ detectors.Versioner = (*Scanner)(nil)
    25added:
    26added: var (
    27added: defaultClient = common.SaneHttpClient()
    28added: // Keys issued before the b10_ prefix: https://docs.baseten.co/organization/api-keys#api-key-format
    29added: keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"baseten"}) + `\b([A-Za-z0-9]{8}\.[A-Za-z0-9]{32})\b`)
    30added: )
    31added:
    32added: type userInfo struct {
    33added: UserID string `json:"user_id"`
    34added: Email string `json:"email"`
    35added: Name string `json:"name"`
    36added: WorkspaceName string `json:"workspace_name"`
    37added: }
    38added:
    39added: func (s Scanner) Version() int {
    40added: return 1
    41added: }
    42added:
    43added: func (s Scanner) Keywords() []string {
    44added: return []string{"baseten"}
    45added: }
    46added:
    47added: // FromData will find and optionally verify Baseten secrets in a given set of bytes.
    48added: func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error) {
    49added: dataStr := string(data)
    50added:
    51added: uniqueMatches := make(map[string]struct{})
    52added: for _, match := range keyPat.FindAllStringSubmatch(dataStr, -1) {
    53added: uniqueMatches[match[1]] = struct{}{}
    54added: }
    55added:
    56added: for match := range uniqueMatches {
    57added: s1 := detectors.Result{
    58added: DetectorType: detector_typepb.DetectorType_Baseten,
    59added: Raw: []byte(match),
    60added: ExtraData: map[string]string{
    61added: "rotation_guide": "https://docs.baseten.co/reference/management-api/api-keys/delete-an-api-key",
    62added: "version": fmt.Sprintf("%d", s.Version()),
    63added: },
    64added: SecretParts: map[string]string{"key": match},
    65added: }
    66added:
    67added: if verify {
    68added: client := s.client
    69added: if client == nil {
    70added: client = defaultClient
    71added: }
    72added:
    73added: isVerified, extraData, verificationErr := verifyMatch(ctx, client, match)
    74added: s1.Verified = isVerified
    75added: maps.Copy(s1.ExtraData, extraData)
    76added: s1.SetVerificationError(verificationErr, match)
    77added: }
    78added:
    79added: results = append(results, s1)
    80added: }
    81added:
    82added: return
    83added: }
    84added:
    85added: func verifyMatch(ctx context.Context, client *http.Client, token string) (bool, map[string]string, error) {
    86added: // Returns 401 for invalid or revoked keys and 403 for valid keys lacking permission (as of 2026-10-28).
    87added: // https://docs.baseten.co/reference/management-api/overview
    88added: req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://api.baseten.co/v1/users/me", nil)
    89added: if err != nil {
    90added: return false, nil, err
    91added: }
    92added: req.Header.Add("Authorization", "Bearer "+token)
    93added:
    94added: res, err := client.Do(req)
    95added: if err != nil {
    96added: return false, nil, err
    97added: }
    98added: defer func() {
    99added: _, _ = io.Copy(io.Discard, res.Body)
    100added: _ = res.Body.Close()
    101added: }()
    102added:
    103added: switch res.StatusCode {
    104added: case http.StatusOK:
    105added: var user userInfo
    106added: if err := json.NewDecoder(res.Body).Decode(&user); err != nil {
    107added: return true, nil, nil
    108added: }
    109added: extraData := map[string]string{
    110added: "user_id": user.UserID,
    111added: "email": user.Email,
    112added: "name": user.Name,
    113added: "workspace_name": user.WorkspaceName,
    114added: }
    115added: for k, v := range extraData {
    116added: if v == "" {
    117added: delete(extraData, k)
    118added: }
    119added: }
    120added: return true, extraData, nil
    121added: case http.StatusForbidden:
    122added: // Valid credentials lacking permission for this endpoint; the key is still live.
    123added: return true, nil, nil
    124added: case http.StatusUnauthorized:
    125added: return false, nil, nil
    126added: default:
    127added: return false, nil, fmt.Errorf("unexpected HTTP response status %d", res.StatusCode)
    128added: }
    129added: }
    130added:
    131added: func (s Scanner) Type() detector_typepb.DetectorType {
    132added: return detector_typepb.DetectorType_Baseten
    133added: }
    134added:
    135added: func (s Scanner) Description() string {
    136added: return "Baseten is a platform for deploying and serving machine learning models. Baseten API keys grant access to model inference and the management API for a user or workspace."
    137added: }
    pkg/detectors/baseten/v2/baseten.go+137−0View file
    @@ -0,0 +1,137 @@
    1added: package baseten
    2added:
    3added: import (
    4added: "context"
    5added: "encoding/json"
    6added: "fmt"
    7added: "io"
    8added: "maps"
    9added: "net/http"
    10added:
    11added: regexp "github.com/wasilibs/go-re2"
    12added:
    13added: "github.com/trufflesecurity/trufflehog/v3/pkg/common"
    14added: "github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
    15added: "github.com/trufflesecurity/trufflehog/v3/pkg/pb/detector_typepb"
    16added: )
    17added:
    18added: type Scanner struct {
    19added: client *http.Client
    20added: }
    21added:
    22added: // Ensure the Scanner satisfies the interface at compile time.
    23added: var _ detectors.Detector = (*Scanner)(nil)
    24added: var _ detectors.Versioner = (*Scanner)(nil)
    25added:
    26added: var (
    27added: defaultClient = common.SaneHttpClient()
    28added: // Key format as of 2026-10-01: https://docs.baseten.co/organization/api-keys#api-key-format
    29added: keyPat = regexp.MustCompile(`\b(b10_[A-Za-z0-9]{8}\.[A-Za-z0-9]{32})\b`)
    30added: )
    31added:
    32added: type userInfo struct {
    33added: UserID string `json:"user_id"`
    34added: Email string `json:"email"`
    35added: Name string `json:"name"`
    36added: WorkspaceName string `json:"workspace_name"`
    37added: }
    38added:
    39added: func (s Scanner) Version() int {
    40added: return 2
    41added: }
    42added:
    43added: func (s Scanner) Keywords() []string {
    44added: return []string{"b10_"}
    45added: }
    46added:
    47added: // FromData will find and optionally verify Baseten secrets in a given set of bytes.
    48added: func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error) {
    49added: dataStr := string(data)
    50added:
    51added: uniqueMatches := make(map[string]struct{})
    52added: for _, match := range keyPat.FindAllStringSubmatch(dataStr, -1) {
    53added: uniqueMatches[match[1]] = struct{}{}
    54added: }
    55added:
    56added: for match := range uniqueMatches {
    57added: s1 := detectors.Result{
    58added: DetectorType: detector_typepb.DetectorType_Baseten,
    59added: Raw: []byte(match),
    60added: ExtraData: map[string]string{
    61added: "rotation_guide": "https://docs.baseten.co/reference/management-api/api-keys/delete-an-api-key",
    62added: "version": fmt.Sprintf("%d", s.Version()),
    63added: },
    64added: SecretParts: map[string]string{"key": match},
    65added: }
    66added:
    67added: if verify {
    68added: client := s.client
    69added: if client == nil {
    70added: client = defaultClient
    71added: }
    72added:
    73added: isVerified, extraData, verificationErr := verifyMatch(ctx, client, match)
    74added: s1.Verified = isVerified
    75added: maps.Copy(s1.ExtraData, extraData)
    76added: s1.SetVerificationError(verificationErr, match)
    77added: }
    78added:
    79added: results = append(results, s1)
    80added: }
    81added:
    82added: return
    83added: }
    84added:
    85added: func verifyMatch(ctx context.Context, client *http.Client, token string) (bool, map[string]string, error) {
    86added: // Returns 401 for invalid or revoked keys and 403 for valid keys lacking permission (as of 2026-10-28).
    87added: // https://docs.baseten.co/reference/management-api/overview
    88added: req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://api.baseten.co/v1/users/me", nil)
    89added: if err != nil {
    90added: return false, nil, err
    91added: }
    92added: req.Header.Add("Authorization", "Bearer "+token)
    93added:
    94added: res, err := client.Do(req)
    95added: if err != nil {
    96added: return false, nil, err
    97added: }
    98added: defer func() {
    99added: _, _ = io.Copy(io.Discard, res.Body)
    100added: _ = res.Body.Close()
    101added: }()
    102added:
    103added: switch res.StatusCode {
    104added: case http.StatusOK:
    105added: var user userInfo
    106added: if err := json.NewDecoder(res.Body).Decode(&user); err != nil {
    107added: return true, nil, nil
    108added: }
    109added: extraData := map[string]string{
    110added: "user_id": user.UserID,
    111added: "email": user.Email,
    112added: "name": user.Name,
    113added: "workspace_name": user.WorkspaceName,
    114added: }
    115added: for k, v := range extraData {
    116added: if v == "" {
    117added: delete(extraData, k)
    118added: }
    119added: }
    120added: return true, extraData, nil
    121added: case http.StatusForbidden:
    122added: // Valid credentials lacking permission for this endpoint; the key is still live.
    123added: return true, nil, nil
    124added: case http.StatusUnauthorized:
    125added: return false, nil, nil
    126added: default:
    127added: return false, nil, fmt.Errorf("unexpected HTTP response status %d", res.StatusCode)
    128added: }
    129added: }
    130added:
    131added: func (s Scanner) Type() detector_typepb.DetectorType {
    132added: return detector_typepb.DetectorType_Baseten
    133added: }
    134added:
    135added: func (s Scanner) Description() string {
    136added: return "Baseten is a platform for deploying and serving machine learning models. Baseten API keys grant access to model inference and the management API for a user or workspace."
    137added: }

Source

Every fact on this page was parsed from trufflesecurity/trufflehog at 2325546, unless a row below says otherwise.

2325546
2921dcc
Parser
trufflehog-detectors-analyzers-v12
Extraction
intel-detector-v7

3 of 32 evidence rows need attention

Evidence rows that need attention
FieldStatusValueSource
lastSeenAt2026-11-25T16:33:44.855ZNo citation
timeoutNone extractedFile
rateLimitNone extractedFile
All 32 evidence rows
All evidence rows
FieldStatusValueSource
descriptionBaseten is a platform for deploying and serving machine learning models. Baseten API keys grant access to model inference and the management API for a user or workspace.File
keywordsbaseten, b10_File
detectorTypesBasetenFile
filesv1/baseten.go, v2/baseten.goFile
patterns\b([A-Za-z0-9]{8}\.[A-Za-z0-9]{32})\b, \b(b10_[A-Za-z0-9]{8}\.[A-Za-z0-9]{32})\bFile
patternTypeprefix_regexFile
statusactiveFile
lastSeenAt2026-11-25T16:33:44.855ZNo citation
rotationGuidehttps://docs.baseten.co/reference/management-api/api-keys/delete-an-api-keyFile
verify.hasVerifyYesFile
verify.httpMethodsGETFile
verify.statusCodesOK, Forbidden, UnauthorizedFile
timeoutNone extractedFile
rateLimitNone extractedFile
errorHandlingSetVerificationError; unexpected HTTP response status %dFile
verify.urlshttps://docs.baseten.co/organization/api-keys#api-key-format, https://docs.baseten.co/reference/management-api/api-keys/delete-an-api-key, https://docs.baseten.co/reference/management-api/overview, https://api.baseten.co/v1/users/meFile
detection.keywordsbasetenLines 43–43
detection.keywordsb10_Lines 43–43
verification.endpointhttps://api.baseten.co/v1/users/meLines 88–88
verification.httpMethodGETLines 88–88
verification.authenticationMethodAuthorization headerLines 92–92
verification.expectedStatuses.verified{"statuses":[200],"names":["StatusOK"],"outcome":"verified"}Lines 104–104
verification.expectedStatuses.verified{"statuses":[403],"names":["StatusForbidden"],"outcome":"verified"}Lines 121–121
verification.expectedStatuses.not_verified{"statuses":[401],"names":["StatusUnauthorized"],"outcome":"not_verified"}Lines 124–124
verification.expectedStatuses.error_or_unknown{"statuses":[],"names":["default"],"outcome":"error_or_unknown"}Lines 126–126
verification.endpointhttps://api.baseten.co/v1/users/meLines 88–88
verification.httpMethodGETLines 88–88
verification.authenticationMethodAuthorization headerLines 92–92
verification.expectedStatuses.verified{"statuses":[200],"names":["StatusOK"],"outcome":"verified"}Lines 104–104
verification.expectedStatuses.verified{"statuses":[403],"names":["StatusForbidden"],"outcome":"verified"}Lines 121–121
verification.expectedStatuses.not_verified{"statuses":[401],"names":["StatusUnauthorized"],"outcome":"not_verified"}Lines 124–124
verification.expectedStatuses.error_or_unknown{"statuses":[],"names":["default"],"outcome":"error_or_unknown"}Lines 126–126
Parser completeness
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Unknown
  • Field status: Unknown
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Not scanned
Package files (2)
  • v1/baseten.go
  • v2/baseten.go