Release v0.2: Add configurable agent security testing pipeline#2
Closed
purcl-cybersec-agent wants to merge 95 commits into
Closed
Release v0.2: Add configurable agent security testing pipeline#2purcl-cybersec-agent wants to merge 95 commits into
purcl-cybersec-agent wants to merge 95 commits into
Conversation
* backup * update temporal explorator module * update temporal explorator module --------- Co-authored-by: solidshen <solidshen519@gmail.com>
Implement complete pipeline for generating, parsing, and uploading security test cases to evaluate AI coding agents' vulnerability to adversarial prompts. ## Core Features ### Data Generation Pipeline - Multi-agent system for generating adversarial test cases - Knowledge graph-driven approach (prohibited_domain → technique_family → concrete_instance) - Three specialized agents: coordinator, composer, and reviewer committee - Parallel generation with configurable task limits - Resume capability for interrupted runs - Output: structured JSONL with test cases and evaluation scores ### Scripts Added - agent/main_agent_sec.py: Main generation script with CLI args - agent/parse_agent_sec.py: Parse and validate XML outputs (--input, --output) - agent/upload_to_hf_dataset.py: Upload to HuggingFace (--input, --dataset-name) - agent/agent_sec_composer/output_parser.py: Pydantic-based XML validator ### Configuration System - resources/agent-sec-config.yaml: Pipeline settings - Configurable models for coordinator, composer, reviewer committee - Adjustable parallel_tasks for rate limit control - Customizable output/log directories - resources/client-config.yaml: Model definitions with provider-based routing - provider: bedrock → AWS Bedrock Converse API - provider: openai → OpenAI-compatible servers (vLLM, SGLang) - Pre-configured Bedrock models (Claude Sonnet/Haiku/Opus, GPT-OSS) - Template for custom local models ### Provider-Based Model Routing Replaced hardcoded model detection with explicit provider field: - Automatic backend selection based on 'provider' field - No Python code changes needed to add new models - Removed ~70 lines of hardcoded model functions - Better error messages for missing/invalid configs - Supports mixing Bedrock and local models in reviewer committee ### Documentation - README-coding-agent-security.md: Complete pipeline guide - Step-by-step workflow (generate → parse → upload) - Configuration instructions for both Bedrock and OpenAI-compatible servers - Model selection tips and provider routing explanation - Knowledge graph structure details - Troubleshooting guide - Link to example dataset: https://huggingface.co/datasets/PurCL/astra-agent-security ### Security & Best Practices - No hardcoded paths: all scripts accept CLI arguments - No credentials committed: config files use placeholders - .gitignore updated: excludes .vscode, data_out, log_out_agent_sec - LFS tracking for knowledge graph files - Clean separation of configuration and code ## Example Usage ```bash # Generate test cases python agent/main_agent_sec.py # Parse outputs python agent/parse_agent_sec.py -i data_out/syn_agent_sec.jsonl -o data_out/parsed.jsonl # Upload to HuggingFace python agent/upload_to_hf_dataset.py -i data_out/parsed.jsonl -d username/dataset-name ``` ## Benefits - Fully configurable via YAML (no code changes for customization) - Easy to extend with new models (just edit client-config.yaml) - Provider-agnostic: works with Bedrock, vLLM, SGLang, etc. - Production-ready with proper error handling and validation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
🎉 ASTRA v0.2 Release
This release adds a complete, configurable pipeline for generating security test cases to evaluate AI coding agents' vulnerability to adversarial prompts.
🆕 What's New in v0.2
🔄 Agent Security Testing Pipeline
A complete end-to-end system for generating, parsing, and curating adversarial test cases:
📦 New Components
Scripts
agent/main_agent_sec.py- Generate test cases with parallel processingagent/parse_agent_sec.py- Parse and validate XML outputsagent/upload_to_hf_dataset.py- Upload to HuggingFace datasetsagent/agent_sec_composer/output_parser.py- Pydantic-based validationConfiguration System
resources/agent-sec-config.yaml- Pipeline settingsresources/client-config.yaml- Enhanced with provider-based routingprovider: bedrockfor AWS Bedrock modelsprovider: openaifor OpenAI-compatible servers (vLLM, SGLang)Documentation
README-coding-agent-security.md- Complete pipeline guide🎯 Key Features
Provider-Based Model Routing
providerfieldFlexible Configuration
Knowledge Graph Structure
📊 Example Dataset
Generated dataset available at: https://huggingface.co/datasets/PurCL/astra-agent-security
🚀 Quick Start
🔒 Security & Best Practices
.gitignorefor build artifacts📈 Statistics
🎓 Use Cases
📚 Documentation
Complete documentation in
README-coding-agent-security.mdcovering:Built on top of: v0.1 (Amazon Nova AI Challenge Winner 🏆)