Feat/webhook levels prompt gurads#4999
Open
403ENDer wants to merge 4 commits into
Open
Conversation
Implements a 5-phase prompt guardrail system to detect and block injection attacks, secret leakage, and unsafe instructions in AI node prompts before they reach the LLM provider. Phase 0 – Schema: Two DB migrations adding 5 guardrail tables (prompt_guardrail_policies, prompt_scan_results, prompt_classifier_results, prompt_override_approvals, prompt_guardrail_bypass_tokens) and 2 execution columns. Field metadata extended with PromptField/SystemPromptField markers. Phase 1 – Dark-launch rule engine: pkg/guardrails/ package with 8 detection rules (6 secret, 2 injection), audit-only default policy, and integration in node_executor via FeaturePromptGuardrails flag. Phase 2 – Warn-only tier: ScanConfiguration returns ScanOutcome; warn_only executions write guardrail_warning to execution Metadata JSON without blocking. Phase 3 – Soft-block + GuardianWorker: GuardrailGuardianWorker polls blocked executions every 30s; resumes on override_approved or times out with guardrail_override_timeout after SoftBlockTimeoutSeconds. Phase 4 – Classifier infrastructure: Classifier interface, NoOpClassifier, ClassifierWorker polling pending jobs in batches, and policy service layer (GetOrgPolicy, UpsertOrgPolicy, ListPendingOverrides, ApproveOverride). Phase 5 – Full enforcement + admin API: AnthropicClassifier calls claude-haiku-4-5-20251001 to confirm findings and refine risk scores. Six admin HTTP handlers under /admin/api for managing org/workflow policies and approving soft-block overrides. Enable in production via env vars: START_GUARDRAIL_GUARDIAN_WORKER=yes START_CLASSIFIER_WORKER=yes ANTHROPIC_CLASSIFIER_API_KEY=<key> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…o webhook-levels-prompt-guardils
|
👋 Commands for maintainers:
|
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.
Summary
This PR introduces two major workstreams:
Webhook Enhancements
The webhook-related changes introduce:
These changes lay the foundation for scalable and deterministic webhook lifecycle management across integrations.
AI Prompt Guardrails
The guardrails-related changes introduce:
Additional Documentation
Branch change documentation:
https://docs.google.com/document/d/1mYKxcyXxF-kckvtUkxRICF08MJMOsbcD-lGthbkOaxA/edit?usp=sharing
MCP server roadmap and suggestions document:
https://docs.google.com/document/d/1kMkTjmXY0yI0TvPEV6LgMyAEGbElqw1VpyHeql_DqWw/edit?usp=sharing
Notes