Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/security / guardrails
guardrails
Guardrails subsystem of @graphorin/security. Exposes the declarative defineInputGuardrail / defineOutputGuardrail builders, the composeGuardrails(...) runner with documented short-circuit semantics, and seven built-ins covering input length, inbound prompt-injection heuristics, PII redaction, language whitelisting, LLM moderation (input + output), and tool-usage validation.
Variables
| Variable | Description |
|---|---|
| guardrails | Bundled namespace of built-in guardrail factories. Mirrors the guardrails.maxLength({ ... }) style used by the framework's documented quick-start. |
Functions
| Function | Description |
|---|---|
| languageWhitelist | Construct the language-whitelist guardrail. |
| llmModeration | Construct an input-side moderation guardrail. |
| maxLength | Construct a maxLength guardrail. Returns an input or output variant depending on the stage option. |
| outputModeration | Construct an output-side moderation guardrail. |
| piiDetection | Construct the PII detection guardrail. |
| promptInjectionHeuristics | Construct the heuristics input guardrail. |
| toolUsageValidator | Construct the tool-usage validator. |
References
ComposedGuardrailResult
Re-exports ComposedGuardrailResult
composeGuardrails
Re-exports composeGuardrails
DEFAULT_INJECTION_PATTERNS
Re-exports DEFAULT_INJECTION_PATTERNS
DEFAULT_PII_PATTERNS
Re-exports DEFAULT_PII_PATTERNS
defineInputGuardrail
Re-exports defineInputGuardrail
defineOutputGuardrail
Re-exports defineOutputGuardrail
DetectedLanguage
Re-exports DetectedLanguage
detectLanguage
Re-exports detectLanguage
GuardrailAction
Re-exports GuardrailAction
GuardrailContext
Re-exports GuardrailContext
GuardrailDefinition
Re-exports GuardrailDefinition
GuardrailResult
Re-exports GuardrailResult
GuardrailStage
Re-exports GuardrailStage
InputGuardrail
Re-exports InputGuardrail
LanguageWhitelistOptions
Re-exports LanguageWhitelistOptions
luhn
Re-exports luhn
MaxLengthOptions
Re-exports MaxLengthOptions
ModerationDecision
Re-exports ModerationDecision
ModerationGuardrailOptions
Re-exports ModerationGuardrailOptions
ModerationProvider
Re-exports ModerationProvider
ObservedToolCall
Re-exports ObservedToolCall
OutputGuardrail
Re-exports OutputGuardrail
PiiDetectionOptions
Re-exports PiiDetectionOptions
PiiPattern
Re-exports PiiPattern
PromptInjectionHeuristicsOptions
Re-exports PromptInjectionHeuristicsOptions
ToolUsageValidatorOptions
Re-exports ToolUsageValidatorOptions