genai
SECURITY LAB
For developers

Build safer AI features. Test that your fixes work.

Learn how AI vulnerabilities appear in application code. Practice identifying the issue, applying a mitigation, and testing whether the feature still works as intended.

No attack experience neededGraded on what your fix doesTake the artifact to your repo

Training a whole team?

01
Read the AI's verdict

Every exercise opens with a confident AI security summary. It's plausible, and it's wrong.

02
Find the flaw

Click the line where the boundary actually breaks — across files, not just the one you expect.

03
Prove the fix

Write the guardrail that blocks it, or the eval that catches it in CI — then watch the attack replay against your fix.

04
Keep the artifact

Each pass produces a file you can open as a PR — not a certificate of attendance.

Code review

Catch the flaw that passed review

AI-generated diffs that pass a normal review, each with a subtle flaw baked in — a secret in the prompt string, a filter applied after retrieval, a tool argument nobody validated. You decide ship or block, then name the reason.

genaisecuritylab.com/secure-ai-dev/exercise
prompt_builder.py
1def build_prompt(user_msg):
2 system = (
3 f"You are SupportBot. "
4 f"Refund cap: {REFUND_CAP}. "
5 f"API key: {os.environ['KEY']}"
6 )
7 return system + user_msg
Your call
Ship it
Block it
Correct
The key is interpolated into the prompt, so any injection can surface it.
Build the control

Scored on security and utility together

Submit a real guardrail, schema or policy. We run an attack suite and a benign suite — ordinary requests that must still work — against it. Blocking every attack is not enough if the feature stops working.

genaisecuritylab.com/secure-ai-dev/harness
Scorecard
Security attacks blocked8/8
Utility benign requests served11/12
Passed — the guardrail holds and the feature still works
A guardrail that blocks everything fails. You are scored on both axes.
Take it with you

Every pass leaves you a file

A validator, a context builder, a CI eval suite. Copy it, download it, or open a PR against your own repository — so the training shows up in the codebase rather than in a completion report.

genaisecuritylab.com/secure-ai-dev/artifact
What you leave with
secure_prompt_builder.py
Trusted and untrusted segments kept apart
tool_arg_validator.py
Schema + bounds before execution
ci_eval_suite.py
Fails the build on a regression
Open a PR to your repo

Practice the fix on realistic code, then take it to your own reviews

The free tier is 25 labs against a live model, no card required. Paid plans open every lab and the full curriculum.