๐Ÿ”ฅLimited Offer: Get 50% OFFon AI & Full Stack Courses๐Ÿ”ฅ
Back to Agentic AI Notes
Topic #17

Agent Actions

An agent's action space is the fixed set of things it's actually allowed to do โ€” usually tool calls, plus the special "produce a final answer" action. The LLM doesn't invent new capabilities; it selects from what's been made available to it.

The Action Space Is Defined by the Developer, Not the Model

Available actions for this agent:
  - search_knowledge_base(query: string)
  - get_order_status(order_id: string)
  - escalate_to_human(reason: string)
  - final_answer(text: string)

The LLM can only choose among these four โ€” it cannot invent a
fifth action that wasn't defined, no matter how it's prompted.

This is a genuine safety property: an agent's worst-case behavior is bounded by what actions actually exist for it to choose from, not by whatever the model might otherwise "want" to do.

Designing a Good Action Space

PrincipleWhy It Matters
Narrow, well-defined actionsEasier for the model to select correctly, easier to validate and secure
Clear, distinct purposesOverlapping actions increase the chance the model picks the wrong one
Explicit escalation/failure actionsGives the agent a defined way to stop instead of forcing a guess when it's uncertain or stuck
Least privilegeOnly include actions the agent genuinely needs for its task โ€” see Least-Privilege Agents

Practical Use Case

A support agent's action space might deliberately exclude a direct "delete_account" action, replacing it with "flag_for_account_deletion_review" โ€” the action space itself is a safety control, not just a functionality list.

Common Mistakes

  • Giving an agent a broad, generic action (like an unrestricted "run_sql(query: string)") when a narrower, purpose-specific action would be safer and easier to validate
  • Omitting an explicit "I don't know" or "escalate" action, forcing the model to always attempt something even when it shouldn't
  • Designing overlapping actions with unclear boundaries, increasing the odds of the model picking a plausible-but-wrong one

Interview Relevance

"How does the action space affect agent safety?" โ€” the key insight: an agent literally cannot take an action that isn't in its defined action space, making the action space itself a genuine security boundary, not just an API surface.

Practice Question

Design the action space (list of named actions, not code) for an HR agent that answers policy questions and can escalate sensitive requests, but should never directly modify payroll data.

Want to go beyond the notes?

Join CodingNow 2.0's Agentic AI course โ€” live mentorship, real projects, and 100% placement support.

Enroll Now โ€” Free Demo Available

Agent Actions โ€“ FAQs

Quick answers about learning Agent Actions in Agentic AI.

This free note from CodingNow 2.0 explains Agent Actions in Agentic AI โ€” concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Agentic AI topic on CodingNow 2.0, including Agent Actions, is 100% free with no signup required.
With focused practice, most students grasp Agent Actions in 1โ€“3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) โ€” expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now