{ "name": "promptgate-rules", "version": "1.0.0", "generated_at": "2026-09-19T01:35:54Z", "source": "app.py (PromptGate Space)", "license": "apache-2.0", "engine": "deterministic regex + heuristics (no model weights)", "regex_flags": [ "IGNORECASE", "MULTILINE", "UNICODE" ], "notes": "Every pattern is applied with re.IGNORECASE | re.MULTILINE | re.UNICODE. Scores are prior confidences, not probabilities. See promptgate_rules.py for the reference matcher that consumes this file.", "thresholds": { "block": 0.8, "sanitize": 0.35, "min_score": 0.3 }, "heuristics": { "entropy_threshold_bits_per_char": 3.6, "entropy_candidate_pattern": "(?" }, { "family": "delimiter_escape", "score": 0.84, "pattern": "\\[/?INST\\]|<<\\s*/?SYS\\s*>>|" }, { "family": "delimiter_escape", "score": 0.82, "pattern": "^\\s*#{2,}\\s*(?:system|instruction|human|assistant|user|context)\\b" }, { "family": "delimiter_escape", "score": 0.62, "pattern": "^\\s*(?:-{3,}|={3,}|\\*{3,}|_{3,})\\s*$" }, { "family": "delimiter_escape", "score": 0.84, "pattern": "^\\s*(?:END|BEGIN)\\s+(?:OF\\s+)?(?:SYSTEM|PROMPT|INSTRUCTIONS?|CONTEXT)(?:\\s+(?:PROMPT|INSTRUCTIONS?|MESSAGE|BLOCK))?\\s*[.:!]?\\s*$" }, { "family": "exfiltration", "score": 0.9, "pattern": "!\\[[^\\]\\n]{0,120}\\]\\(\\s*https?://[^)\\s]+\\)" }, { "family": "exfiltration", "score": 0.86, "pattern": "\\b(?:send|post|upload|exfiltrate|transmit|forward|leak|report|submit)\\b[^.\\n]{0,40}?\\b(?:to|via|through)\\b[^.\\n]{0,20}?(?:https?://|webhook|endpoint|api\\.[a-z0-9.\\-]+|my\\s+server)" }, { "family": "exfiltration", "score": 0.78, "pattern": "https?://[^\\s)\\]\\\"']{0,200}[?&](?:q|d|data|text|payload|prompt|c|msg|body|content|secret|token)=" }, { "family": "exfiltration", "score": 0.82, "pattern": "\\b(?:curl|wget|fetch|xhr|http\\s+get)\\b[^\\n]{0,20}https?://" }, { "family": "exfiltration", "score": 0.88, "pattern": "\\b(?:fetch|open|visit|download|read|browse|go\\s+to|retrieve)\\b[^\\n]{0,24}https?://[^\\s]{1,200}[^\\n]{0,40}?\\b(?:and\\s+)?(?:follow|obey|execute|apply|comply|do\\s+(?:\\w+\\s+){0,3}(?:what|as))\\b" }, { "family": "exfiltration", "score": 0.7, "pattern": "]{0,200}\\bsrc\\s*=\\s*[\\\"']?https?://" }, { "family": "exfiltration", "score": 0.84, "pattern": "\\b(?:append|add|attach|embed|include|concatenate)\\b[^.\\n]{0,44}?\\b(?:to|in|into|onto)\\b[^.\\n]{0,24}?https?://" }, { "family": "exfiltration", "score": 0.84, "pattern": "(?:外部(?:の)?(?:URL|サーバ|サーバー|サイト)|下記URL)[^。\\n]{0,20}?(?:送信|送って|アップロード|投稿)" } ], "secrets": [ { "type": "OPENAI_KEY", "score": 0.96, "pattern": "\\bsk-(?:proj-|svcacct-|admin-)?[A-Za-z0-9_\\-]{20,}\\b" }, { "type": "ANTHROPIC_KEY", "score": 0.96, "pattern": "\\bsk-ant-(?:api|admin)[A-Za-z0-9_\\-]{20,}\\b" }, { "type": "GITHUB_TOKEN", "score": 0.96, "pattern": "\\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{30,}\\b" }, { "type": "GITHUB_PAT", "score": 0.96, "pattern": "\\bgithub_pat_[A-Za-z0-9_]{50,}\\b" }, { "type": "AWS_ACCESS_KEY", "score": 0.95, "pattern": "\\b(?:AKIA|ASIA|ABIA|ACCA)[0-9A-Z]{16}\\b" }, { "type": "SLACK_TOKEN", "score": 0.95, "pattern": "\\bxox[abprs]-[A-Za-z0-9\\-]{10,}\\b" }, { "type": "SLACK_APP_TOKEN", "score": 0.95, "pattern": "\\bxapp-\\d-[A-Za-z0-9\\-]{10,}\\b" }, { "type": "GOOGLE_API_KEY", "score": 0.94, "pattern": "\\bAIza[0-9A-Za-z_\\-]{35}\\b" }, { "type": "HF_TOKEN", "score": 0.94, "pattern": "\\bhf_[A-Za-z0-9]{30,}\\b" }, { "type": "GITLAB_TOKEN", "score": 0.92, "pattern": "\\bglpat-[A-Za-z0-9_\\-]{18,}\\b" }, { "type": "STRIPE_KEY", "score": 0.95, "pattern": "\\b(?:sk|rk|pk)_(?:live|test)_[A-Za-z0-9]{16,}\\b" }, { "type": "SENDGRID_KEY", "score": 0.93, "pattern": "\\bSG\\.[A-Za-z0-9_\\-]{20,}\\.[A-Za-z0-9_\\-]{20,}\\b" }, { "type": "TWILIO_SID", "score": 0.9, "pattern": "\\bAC[0-9a-fA-F]{32}\\b" }, { "type": "DIGITALOCEAN_TOKEN", "score": 0.92, "pattern": "\\bdop_v1_[A-Za-z0-9]{32,}\\b" }, { "type": "NPM_TOKEN", "score": 0.9, "pattern": "\\bnpm_[A-Za-z0-9]{30,}\\b" }, { "type": "PRIVATE_KEY_BLOCK", "score": 0.98, "pattern": "-----BEGIN\\s+(?:RSA\\s+|EC\\s+|DSA\\s+|OPENSSH\\s+|PGP\\s+)?PRIVATE\\s+KEY[^\\n]*-----" }, { "type": "JWT", "score": 0.88, "pattern": "\\beyJ[A-Za-z0-9_\\-]{8,}\\.[A-Za-z0-9_\\-]{8,}\\.[A-Za-z0-9_\\-]{8,}\\b" }, { "type": "BEARER_TOKEN", "score": 0.72, "pattern": "\\b(?:Bearer|Authorization\\s*[:=])\\s+[A-Za-z0-9_\\-\\.=]{20,}" }, { "type": "CREDENTIAL_PAIR", "score": 0.75, "pattern": "\\b(?:basic\\s+auth(?:entication)?|credentials?|login|log\\s?in|user(?:name)?|account)\\b[^.\\n]{0,24}?\\b[A-Za-z0-9._\\-]{3,32}:[^\\s:@/\\\"']{6,40}(?![\\w.])" }, { "type": "CONNECTION_STRING", "score": 0.86, "pattern": "\\b(?:postgres|postgresql|mysql|mongodb(?:\\+srv)?|redis|amqp)://[^\\s:@/]{1,64}:[^\\s@/]{1,64}@[^\\s/]{3,}" }, { "type": "GENERIC_ASSIGNED_SECRET", "score": 0.7, "pattern": "\\b(?:api[_\\-]?key|apikey|secret[_\\-]?key|access[_\\-]?token|auth[_\\-]?token|password|passwd|pwd|client[_\\-]?secret)\\b\\s*[:=]\\s*[\\\"']?[A-Za-z0-9_\\-\\.\\/+]{12,}[\\\"']?" } ], "pii": { "EMAIL": { "pattern": "(?