How azure/counterfit works
Counterfit is a machine-learning security assessment tool that provides a common interface to adversarial attack frameworks. The principal workflow is to create or select a target, build and run an attack against it, then inspect attack results and reports. Framework integrations include ART, AugLy, and TextAttack; target examples cover image, text, tabular, and reinforcement-learning workloads. The graph reflects documented workflow and source-index references; unsampled implementation details are not inferred as definite call paths.
Main entry points: targets.py Target Interface · core.py Assessment Orchestrator · attacks.py Attack Run State · reporting.py Report Aggregation
Components 20
Assessment Core
- Assessment Orchestrator
counterfit/core/core.py - Attack Run State
counterfit/core/attacks.py - Attack Options
counterfit/core/options.py - Framework Contract
counterfit/core/frameworks.py - Query Logger
counterfit/core/logger.py - Parameter Optimizer
counterfit/core/optimize.py
Attack Frameworks
- ART Integration
counterfit/frameworks/art/art.py - AugLy Integration
counterfit/frameworks/augly/augly.py - TextAttack Integration
counterfit/frameworks/textattack/textattack.py
Model Targets
- Target Interface
counterfit/core/targets.py - Image Targets
counterfit/targets/digits_keras.py - Review Target
counterfit/targets/movie_reviews.py - Tabular Targets
counterfit/targets/creditfraud.py - Cart-Pole Target
counterfit/targets/cart_pole/cart_pole.py
Results and Reporting
- Report Aggregation
counterfit/core/reporting.py - Image Reports
counterfit/reporting/image.py - Tabular Reports
counterfit/reporting/tabular.py - Text Reports
counterfit/reporting/text.py - Console Output
counterfit/core/output.py
Other components
- Engineer
Connections 23
- Engineer → Assessment Orchestrator: starts assessment
- Assessment Orchestrator → Target Interface: builds target
counterfit/core/core.py - Assessment Orchestrator → Attack Run State: builds attack
counterfit/core/core.py - Assessment Orchestrator → Framework Contract: discovers frameworks
counterfit/core/core.py - Assessment Orchestrator → Attack Options: configures attack
counterfit/core/core.py - Assessment Orchestrator → Attack Run State: runs framework
counterfit/core/core.py - Attack Run State → Target Interface: gets samples
counterfit/core/attacks.py - Attack Run State → Target Interface: gets labels
counterfit/core/attacks.py - Attack Run State → Attack Options: reads options
counterfit/core/attacks.py - Attack Run State → Query Logger: creates logger
counterfit/core/attacks.py - ART Integration → Target Interface: wraps target
counterfit/frameworks/art/art.py - AugLy Integration → Target Interface: uses target
counterfit/frameworks/augly/augly.py - TextAttack Integration → Framework Contract: implements contract
counterfit/frameworks/textattack/textattack.py - Image Targets → Target Interface: implements target
counterfit/targets/digits_keras.py - Review Target → Target Interface: implements target
counterfit/targets/movie_reviews.py - Tabular Targets → Target Interface: implements target
counterfit/targets/creditfraud.py - Cart-Pole Target → Target Interface: implements target
counterfit/targets/cart_pole/cart_pole.py - Image Reports → Report Aggregation: extends reports
counterfit/reporting/image.py - Tabular Reports → Report Aggregation: extends reports
counterfit/reporting/tabular.py - Text Reports → Report Aggregation: extends reports
counterfit/reporting/text.py - Report Aggregation → Console Output: prints summaries
counterfit/core/reporting.py - Image Reports → Console Output: prints results
counterfit/reporting/image.py - Assessment Orchestrator → Parameter Optimizer: optimizes parameters