Spaces:
Sleeping
Sleeping
Download security/rules/policy.yaml from ksk76/structural-encoder-uplan: direct link, hf CLI and curl.
- Browser
- Download file 2.61 kB
-
https://huggingface.co/spaces/ksk76/structural-encoder-uplan/resolve/main/security/rules/policy.yaml
- Command line
-
hf download hf://spaces/ksk76/structural-encoder-uplan/security/rules/policy.yaml
-
curl -L -o policy.yaml https://huggingface.co/spaces/ksk76/structural-encoder-uplan/resolve/main/security/rules/policy.yaml
2.61 kB
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Uplan β Lobster Trap YAML Policy (Phase 2 β Scaffolded) | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # First-match-wins policy rules for Lobster Trap DPI proxy. | |
| # These rules inspect BOTH prompts (ingress) and responses (egress). | |
| version: "1.0" | |
| name: uplan-immigration-policy | |
| rules: | |
| # ββ Egress: Block PII in responses ββββββββββββββββββββββββββββββββ | |
| - id: deny-passport-plaintext | |
| direction: egress | |
| description: "Block passport numbers from appearing in plaintext responses" | |
| match: | |
| pattern: '\b[A-Z]{1,2}\d{6,9}\b' | |
| context: "Passport number pattern detected in model response" | |
| action: DENY | |
| severity: critical | |
| - id: deny-account-numbers | |
| direction: egress | |
| description: "Block bank account numbers in plaintext responses" | |
| match: | |
| pattern: '\b\d{8,18}\b' | |
| context: "Potential account number in model response" | |
| action: DENY | |
| severity: critical | |
| # ββ Ingress: Block prompt injection βββββββββββββββββββββββββββββββ | |
| - id: deny-prompt-injection | |
| direction: ingress | |
| description: "Block common prompt injection patterns" | |
| match: | |
| pattern: '(ignore previous|forget your instructions|you are now|new system prompt)' | |
| flags: case_insensitive | |
| action: DENY | |
| severity: critical | |
| # ββ Logging: Audit all financial data access ββββββββββββββββββββββ | |
| - id: log-financial-access | |
| direction: ingress | |
| description: "Log all prompts containing financial graph data" | |
| match: | |
| pattern: '"financial":\s*\{' | |
| action: LOG | |
| severity: info | |
| - id: log-identity-access | |
| direction: ingress | |
| description: "Log all prompts containing identity data" | |
| match: | |
| pattern: '"identity":\s*\{' | |
| action: LOG | |
| severity: info | |
| # ββ Fallback: Allow everything else βββββββββββββββββββββββββββββββ | |
| - id: allow-default | |
| direction: both | |
| description: "Allow all traffic not matched by previous rules" | |
| match: | |
| pattern: '.*' | |
| action: ALLOW | |
| severity: info | |