Spaces:
Sleeping
Sleeping
Commit History
-
Phase 3: defense wrappers + Colab smoke/benchmark cells
- env/defenses/prompt_guard.py: lazy-loaded transformers pipeline for Llama-Prompt-Guard-2-86M. Labels MALICIOUS/BENIGN, score is P(injection). Truncates at 512 tokens per model card. - env/defenses/secalign_agent.py: vLLM + LoRA loader for Meta-SecAlign-8B. Untrusted slot content goes in "input" role per the SecAlign prompt template. Falls back to plain Llama-3.1-8B-Instruct with a SecAlign-style system prompt if LoRA load fails — logs mode with logger.warning. temperature=0.0, seed=42 for near-determinism. gpu_memory_utilization=0.70 to leave headroom for PG2 + FW. - env/defenses/llama_firewall.py: FirewallWrapper wraps LlamaFirewall with PromptGuard on Role.USER and AgentAlignment on Role.ASSISTANT. scan(user_query, agent_output, tool_call) combines both scans; flagged=True if either blocks; score=max across both. - env/defenses/__init__.py: exports all three wrappers + base types. - notebooks/colab_runner.ipynb: Cell 3 (smoke tests) and Cell 4 (latency bench…a9424d2