org.llm4s.agent.guardrails.patterns.SecretPatterns.SecretType
See theSecretType companion object
A single category of secret credential.
The built-in types are in the companion. The class is open: an application adds its own credential format with new SecretType("Acme token", """acme_[A-Za-z0-9]{32}""".r, "[REDACTED_ACME_TOKEN]") and passes it to SecretLeakGuardrail beside the built-in ones. A pattern runs on text a model or a user supplies, so write one that takes linear time: no nested quantifiers, and no scan to the end of a run from every position in it.
Value parameters
- name
-
human-readable label used in error messages
- pattern
-
the regex that recognises this credential. When it has a capturing group, group 1 is the secret and the rest of the match is context that is kept; otherwise the whole match is
- placeholder
-
what to write in place of the secret when masking
Attributes
- Companion
- object
- Source
- SecretPatterns.scala
- Graph
-
- Supertypes
- Known subtypes
-
object AnthropicKeyobject AwsAccessKeyobject GoogleApiKeyobject JwtTokenobject LangfuseKeyobject OpenAIKeyobject PrivateKeyPemobject VoyageKey
Members list
In this article
