Back to cheat sheet hub

AI Agents Cheat Sheet

A compact reference for the agent loop and the practical agent patterns we teach for QA and automation work.

Observe / think / act Tools and memory Guardrails and evaluation

What Makes an Agent

An agent is more than a prompt. It loops and takes actions toward a goal.

Agent = model + tools + goal + memory + loop

The Agent Loop

This is the simplest mental model to remember.

Observe current state
Think about next best action
Act using a tool
Observe result
Repeat until goal is met

Common Agent Roles

These show up repeatedly in testing-oriented systems.

Planner:
understands the app and creates a plan

Generator:
writes or updates test code

Healer:
diagnoses and fixes broken tests

Useful Agent Tools

Agents become valuable when they can interact with real systems.

- browser automation
- file read/write
- terminal commands
- issue trackers
- HTTP APIs
- vector search / RAG

Memory

Memory helps the agent retain context across steps or sessions.

Short-term memory:
- current conversation / task state

Long-term memory:
- saved facts
- previous outcomes
- user preferences

Good Agent Prompts

Agent prompts should define role, objective, limits, and when to stop.

You are a QA planning agent.
Explore the target application.
Identify high-risk flows.
Do not make destructive changes.
Return a prioritized test plan in markdown.

Guardrails

Agents need boundaries, especially when tools can write or execute.

- limit tool scope
- require confirmation for risky actions
- cap retries
- restrict secrets access
- log actions and outputs

Evaluation

Agent quality should be measured by outcome quality, not how smart the logs sound.

Measure:
- task completion
- correctness
- efficiency
- unnecessary actions
- safe behavior
- repeatability

QA Use Cases

These are realistic places where agents can assist testing teams right now.

- test planning from requirements
- code review for flaky tests
- CI failure triage
- test data generation
- bug summary writing
- healing locator changes