Cheat sheet · Specialise
AI security cheat sheet (Red-teaming and evaluation)
Opens with creditsFor learners heading into AI red-teaming and evaluation: foundations, how apps break, the OWASP and ATLAS maps, the defences you test against, safe agent harnesses, the supply chain, test plans, tools, scoring and reports, monitoring and a career route. Method over tricks, no payloads.
Chapters
9 chapters · 80 concepts
1Security foundations for AI workThe general security ideas every AI security task stands on. The Cybersecurity roadmap at /roadmaps/cybersecurity/ covers them in more depth.10 concepts
- 1Threat modelling (four questions)A structured way to find risks early by answering four questions: what are we working on, what can go wrong, what are we going to do about it, and did we do a…
- 2Trust boundaryA line where data or control passes between parts that deserve different trust, such as the internet and your server.
- 3Least privilegeEach person, service, agent and tool gets only the access its job needs, for only as long as it needs it.
- 4Authentication and authorisationAuthentication checks who someone is; authorisation checks what they may do.
- 5Secrets managementKeeping keys, passwords and tokens in a secrets manager or server-side environment, narrowly scoped, rotated and out of code, prompts and logs.
- 6Defence in depthStacking independent controls so one failure does not become a breach: identity, scoped data, narrow tools, encoding, guards, limits, logs and a kill switch.
- 7Classic web weaknesses in AI appsInjection, cross-site scripting and broken access control, now often arriving through model output instead of a form field.
- 8Server-side request forgeryTricking a server into fetching an address the attacker chooses, such as an internal service or a cloud metadata endpoint.
- 9Rules of engagementWritten permission and scope for a test: which systems, methods, harm types, rates, cost limits, data handling, times and escalation contacts.
- 10Severity for AI findingsRating a finding by likelihood and impact, recording the success rate over many attempts and judging impact by what the app can do.
10 in this chapterOpen this chapter2How LLM apps and agents breakFollow a request through an LLM app and an agent to see where text gets in and where actions get out.7 concepts
- 1Context assemblyThe text an app builds for the model: system prompt, history, retrieved documents, tool descriptions and results, and the user's message.
- 2Instructions and data in one channelA model reads instructions and data as the same stream of text and decides by probability which parts to follow.
- 3Retrieval permissionsFiltering retrieval by who is asking, in the query itself, and controlling who can write to indexed sources.
- 4Agent loopA loop where the model asks for a tool call, code runs it, the result returns to the context, and the model decides again.
- 5Non-determinismThe same input can give different outputs across runs and model versions.
- 6Lethal trifectaSimon Willison's name for three capabilities that together let an injection steal data: private data, untrusted content and a way to communicate out.
- 7Practice target appA small LLM app you own: a local or spend-capped model, a system prompt, retrieval over your own documents and two harmless tools.
7 in this chapterOpen this chapter- Risk maps: OWASP, ATLAS, NIST, SAIFThe shared vocabularies of AI security. The OWASP LLM Top 10 2025 is still the current edition as of October 2026.7 conceptsOpens with credits
- Prompt injection and the guard layersPrompt injection as an attack class and the layers that reduce it. No single control is enough; design limits the damage.10 conceptsOpens with credits
- Agent, tool and MCP securityWhat agents can do, and how to keep it narrow. MCP details follow the current stateless specification; check your SDK's revision.11 conceptsOpens with credits
- Data and model supply chainRisks that arrive before a user types anything: the data, the model files and what leaks from both.10 conceptsOpens with credits
- Testing, red-teaming and evalsHow AI systems are tested responsibly, and the main open source tools by purpose. Point them only at systems you own or are authorised to test.11 conceptsOpens with credits
- Monitoring and incident responseSeeing what an AI app does in production, switching off harm quickly and learning from each incident.7 conceptsOpens with credits
- Career: roles, certifications and portfolioWhere the work is and how to show you can do it. Certification facts are as of October 2026; check official pages before paying.7 conceptsOpens with credits
- 10Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.135 terms
About this sheet
Secure LLM apps and agents, test models safely.
Related on Sefism
Picked from the other libraries by shared topics.
Roadmaps
See allBest practices
See all- Threat Modeling Best PracticesMake threat modeling a routine part of building features: the four questions, data flow diagrams, STRIDE, abuse cases, tickets and tests, and LLM features.
- Secrets Management Best PracticesKeep API keys, passwords and tokens out of git, logs and browser bundles: secret managers, scanning, rotation, OIDC in CI and leak response.
- Authentication Best PracticesBuild sign-in that holds up: password rules from NIST, Argon2id hashing, login throttling, MFA and passkeys, secure sessions and safe account recovery.
Checklists
See all- Web Application Security ChecklistA practical web application security checklist built on the OWASP Top 10:2025 and ASVS 5.0, with a severity and a way to verify every check.
- API Security ChecklistCheck your REST or GraphQL API against the OWASP API Security Top 10: authentication, object authorization, rate limits, input validation, SSRF, CORS and logging.
- Linux Server Hardening ChecklistHarden an Ubuntu, Debian or RHEL server step by step: accounts and sudo, SSH, updates, firewall and open ports, permissions, logging and CIS benchmark scans.
Project structures
See all- AI agent with an MCP server project structureFor developers who want to give AI assistants safe access to their own data or API. A TypeScript MCP server built on the official SDK, organised by feature (tasks, projects) with each feature owning its tools, resources and prompts, served over stdio for local hosts and Streamable HTTP with OAuth for remote ones, plus a small agent and the evals that prove a model can use it.
- Firebase (Cloud Functions and security rules) project structureFor students building an app on Firebase who need a real backend: Cloud Functions (2nd gen) in TypeScript, Firestore and Storage security rules with tests, and the Local Emulator Suite. The tree starts from
firebase initand grows into feature folders of callables, triggers and scheduled jobs, then adds CI deploys, environments, contract tests and runbooks. - Terraform project structureAn infrastructure repository for a small app on AWS: reusable modules, one folder per environment with its own remote state, pinned providers, tests and security scans, with plan on every pull request and apply from CI. For students who have finished the Terraform tutorials and want to know how a real team lays out the files. The same layout works unchanged with OpenTofu.
Career questions
See all- How do I get into AI security as a student or junior engineer?Build a normal security or software foundation first, then learn how LLM apps fail using the OWASP Top 10 for LLM Applications and MITRE ATLAS, and prove it by building, testing and hardening a small LLM app of your own. Most people reach AI security through AppSec, security engineering or ML engineering, not straight from university.
- Can I use AI coding tools at my internship, and what should I never paste into them?Usually yes, but only the tools your company has approved, on the code and data they allow, and in the way they allow. Ask in your first week. Never paste secrets, customer data or code you are not permitted to share, and review everything the tool writes as if your name is on it, because it is.
- Where do I start if I want a career in cybersecurity or IT operations?Start with the foundations both fields share: networking, Linux, and how systems fail. Then choose an entry role such as SOC analyst, IT support or junior cloud operations, and prove it with hands-on labs and one documented project rather than a stack of certificates.
Work with me
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
- 1:1 Mentorship
- Fresh Graduate Mentorship
- Career Guidance
Brand deals, promos and partnerships: tauseeffayyaz@gmail.com