adversarial-training
Defensive techniques using adversarial examples to improve model robustness and security
npx skills add majiayu000/claude-skill-registry --skill adversarial-training --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Adversarial Training Build **robust AI models** by training with adversarial examples and attack simulations. ## Quick Reference ```yaml Skill: adversarial-training Agent: 05-defense-strategy-developer OWASP: LLM04 (Data Poisoning), LLM09 (Misinformation) NIST: Manage function Use Case: Improve model robustness against attacks ``` ## Training Methods ### 1. Standard Adversarial Training ```yaml Method: standard Robustness Gain: 30-50% Accuracy Tradeoff: 5-15% Complexity: Medium ``` ```python class AdversarialTrainer: def __init__(self, model, epsilon=0.3, attack_steps=10): self.model = model self.epsilon = epsilon self.attack_steps = attack_steps def train_step(self, x, y): # Generate adversarial examples using PGD x_adv = self.pgd_attack(x, y) # Train on both clean and adversarial loss_clean = self.criterion(self.model(x), y) loss_adv = self.criterion(self.model(x_adv), y) # Weighted combination total_loss = 0.5 * loss_clean + 0.5 * loss_adv return total_loss def pgd_attack(self, x, y): """Projected Gradient Descent attack""" x_adv = x.clone().requires_grad_(True) for _ in range(self.attack_steps): loss = self.criterion(self.model(x_adv), y) loss.backward() # Step in gradient di
- Quick Reference
- Training Methods
- 1. Standard Adversarial Training
- 2. TRADES (Tradeoff Defense)
- 3. Certified Defense
- Attack Types to Train Against
- Training Pipeline
- LLM-Specific Training
- Effectiveness Metrics
- Troubleshooting
- Integration Points
What does the adversarial-training skill do?
Defensive techniques using adversarial examples to improve model robustness and security
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill adversarial-training --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
