Agent skill · Security

adversarial-training

Defensive techniques using adversarial examples to improve model robustness and security

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill adversarial-training --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 8 KB
Bundled scripts: none
Version: 2.0.0
Path: skills/ai-ml/adversarial-training/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. Quick Reference
  2. Training Methods
  3. 1. Standard Adversarial Training
  4. 2. TRADES (Tradeoff Defense)
  5. 3. Certified Defense
  6. Attack Types to Train Against
  7. Training Pipeline
  8. LLM-Specific Training
  9. Effectiveness Metrics
  10. Troubleshooting
  11. Integration Points
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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.

Keep going