CCDV-F Agents and the Agent SDK Practice Question
A developer is building an agent that runs shell commands to inspect a repository. They want the agent to iterate autonomously but prevent destructive commands like deleting files outside the project directory. Which combination best enforces this boundary while preserving autonomy?
⚠ Common exam trap
The trap here is believing that a strong system prompt instruction provides a security guarantee equivalent to code-level enforcement.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Route shell commands through a permission callback that inspects each command and denies those targeting paths outside the project directory.
Safety boundaries for autonomous agents must be enforced outside the model's discretion. A permission callback inspects every shell invocation before it runs and denies those reaching outside the project directory, which blocks destructive operations while still allowing the agent to iterate freely on permitted commands. Prompt guidance and token limits are advisory or orthogonal, and removing shell access discards needed capability.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Route shell commands through a permission callback that inspects each command and denies those targeting paths outside the project directory.
Why this is correct
A permission callback intercepts each tool invocation before execution, allowing programmatic inspection and denial of unsafe commands while permitting legitimate ones. This enforces a hard boundary in application code and lets the agent continue autonomous iteration within the allowed scope, matching the requirement to constrain without disabling.
- ✗
Restrict the agent to read-only tools and remove shell execution entirely from its toolset.
Why it's wrong here
Removing shell execution eliminates destructive risk but also removes the capability the agent needs to iterate on repository tasks. The scenario asks to preserve autonomous command execution within a safe scope, so a blanket removal solves safety by sacrificing the required functionality rather than balancing both.
- ✗
Lower the model's max_tokens so it cannot compose long destructive command strings.
Why it's wrong here
max_tokens limits response length, not command semantics. A short destructive command such as a recursive delete fits easily within a reduced token budget, so this control does not prevent the behavior. It also degrades the agent's ability to produce useful longer outputs without addressing the safety boundary.
- ✗
Rely on the system prompt instructing the model to never run destructive commands.
Why it's wrong here
Prompt-level instructions are advisory and can be overridden by ambiguous tasks or model error. They provide no hard guarantee that a destructive command will not be emitted. For a safety boundary that must hold, enforcement has to occur in code outside the model's discretion, not in natural-language guidance.
About these practice questions
Courseiva writes every CCDV-F question from scratch — 257 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Anthropic exam blueprint
This CCDV-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCDV-F exam.