Repository navigation
Conversation
eeee2345
force-pushed
the
feat/perplexity-detector
branch
from
November 30, 2026 06:05
e393214 to
aced6f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Adds a detector and verifier for Perplexity API keys.
Perplexity's API (search, Agent API and model inference) is paid per request and billed to the key owner's account. Keys are
pplx-followed by 48 alphanumeric characters; the same shape is used by gitleaks'perplexity-api-keyrule.Verification uses the read-only List Models endpoint:
GET https://api.perplexity.ai/v1/modelswithAuthorization: Bearer <key>(https://docs.perplexity.ai/api-reference/models-get)The structure follows the Fireworks detector added in #5447.
Changes:
proto/detector_type.proto:Perplexity = 1078;(happy to renumber if another detector lands first)pkg/pb/detector_typepb/detector_type.pb.go: regenerated withmake protospkg/detectors/perplexity/: detector, unit tests (pattern, including too-short and too-long keys, and verifier status handling via a fake transport), and an integration test that readsPERPLEXITY/PERPLEXITY_INACTIVEfrom thedetectors5test secretpkg/engine/defaults/defaults.go: registered in the default detectorsI don't have a live Perplexity key, so the integration test has not been run against a verified key and the secrets would need adding on your side. I did build the binary and run
trufflehog filesystem --include-detectors=Perplexityon a file with a well-formed fake key: it is reported once, with live verification returning unverified and no verification error.Checklist:
go test ./pkg/detectors/perplexity/... ./pkg/engine/defaults/...(did not run the fullmake test-community)golangci-lint run ./pkg/detectors/perplexity/...reports 0 issues;gofmt,go vet(with and without thedetectorstag),go run ./hack/checksecretparts -fail ./pkg/detectorsand thehack/semgrep-rules/detectors.yamlsemgrep rules are cleanNote
Low Risk
Additive detector following the same pattern as other API-key scanners; verification only performs a read-only models list request when explicitly enabled.
Overview
Introduces a new Perplexity secret detector so TruffleHog can find
pplx-keys (48 alphanumeric characters after the prefix) in scanned content, with optional live verification.Detection uses keyword
pplx-and a bounded regex; results include a rotation guide andSecretParts. When verification is enabled, keys are checked with a read-onlyGET https://api.perplexity.ai/v1/modelscall—200 marks verified, 401 unverified, other statuses or transport failures surface as verification errors.Wiring adds
DetectorType_Perplexity = 1080inproto/detector_type.proto(and regenerateddetector_type.pb.go), registersperplexity.Scannerin default detectors, and adds unit tests (pattern edge cases, mocked HTTP verifier) plus adetectors-tagged integration test against GCP test secrets.Reviewed by Cursor Bugbot for commit aced6f9. Bugbot is set up for automated code reviews on this repo. Configure here.