Bird
0
0

Given this code snippet:

medium📝 Predict Output Q4 of 15
Agentic AI - Agent Safety and Guardrails
Given this code snippet:
guardrails = Guardrails()
guardrails.block('send_email')
agent = Agent(guardrails=guardrails)
result = agent.perform('send_email')

What will be the value of result?
A'Email sent successfully'
B'Error: action not found'
C'Action blocked: send_email'
D'No guardrails applied'
Step-by-Step Solution
Solution:
  1. Step 1: Understand the guardrail blocking 'send_email'

    The guardrail blocks the 'send_email' action, so the agent cannot perform it.
  2. Step 2: Determine the agent's response to blocked action

    The agent returns a message indicating the action was blocked.
  3. Final Answer:

    'Action blocked: send_email' -> Option C
  4. Quick Check:

    Blocked action = 'Action blocked' message [OK]
Quick Trick: Blocked actions return a block message [OK]
Common Mistakes:
  • Assuming action succeeds despite guardrail
  • Expecting an error instead of block message
  • Ignoring guardrail effect on agent

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes