Beginner-Friendly Topic
Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on.You've got this!
Agent Actions
Actions are what an agent does in the world. Every tool call, API request, file operation, and message sent is an action. Safe action design is critical for reliable agents.
Types of Agent Actions
- Read actions: searching, querying a database, reading a file, calling a read-only API endpoint
- Write actions: creating a record, updating a file, sending an email, posting a message
- Compute actions: calculating a value, transforming data, running a script
- Wait actions: pausing for a condition, waiting for an approval, scheduling a future step
- Escalate actions: flagging a task for human review, pausing and notifying a user
Safe Action Design
Not all actions are equally risky.
Read actions are low risk. If a read action fails or produces wrong data, the agent can try again without causing harm.
Write actions are higher risk. Sending an incorrect email, deleting the wrong file, or posting an incorrect update can cause real problems.
High-risk actions should always be validated before execution. The agent should:
1. Check the action arguments are correct
2. Confirm the action is within its permitted scope
3. Request human approval for irreversible actions
4. Log the action before and after execution
Key Takeaways
- Actions are what an agent does in the world.
- Read actions: searching, querying a database, reading a file, calling a read-only API endpoint
- Write actions: creating a record, updating a file, sending an email, posting a message
- Compute actions: calculating a value, transforming data, running a script