Skip to content

CCAR-P · Domain 3: Integration · 21% of the exam

Task 3.1: Least-Privilege Tool Configuration

Reviewing the tools an agent or subagent is given against least privilege and a minimal footprint, and deciding which connections to drop, narrow or replace with a lighter way of reaching the data.

Study it

  • Least-privilege tool sets for agents and subagents

    Partly covered by: Guardrails

Sample questions

Try each one before opening the answer. Every option is explained, with the Anthropic documentation page that proves it.

Question 1 · choose 1

A report-summarizing agent runs in an isolated container, and the team keeps it in bypassPermissions mode so that it never waits for approval. A least-privilege review says the agent may read and search files but must never write, edit or run shell commands. The current Python Claude Agent SDK options:options = ClaudeAgentOptions( permission_mode="bypassPermissions", allowed_tools=["Read", "Grep", "Glob"], )Logs show the agent editing files and running Bash. Which change meets the review while keeping the mode?

  1. AKeep the options as they are, because allowed_tools already limits the agent to the three listed tools
  2. BAdd disallowed_tools=["Write", "Edit", "Bash"], so that those three tools are removed from the agent
  3. CAdd a can_use_tool callback that denies Write, Edit and Bash, so that each of those calls is refused
  4. DAdd disallowed_tools=["Bash(rm *)", "Bash(git push *)"], so that the risky shell commands are blocked
Show the answer and why
  • AKeep the options as they are, because allowed_tools already limits the agent to the three listed tools

    Incorrect

    allowed_tools pre-approves the listed tools; it doesn't constrain bypassPermissions, which approves unlisted tools too.

  • BAdd disallowed_tools=["Write", "Edit", "Bash"], so that those three tools are removed from the agent

    Correct

    Deny rules apply before the mode check, and a bare tool name in disallowed_tools removes that tool's definition.

  • CAdd a can_use_tool callback that denies Write, Edit and Bash, so that each of those calls is refused

    Incorrect

    In bypassPermissions mode most calls are approved without reaching the callback, so it wouldn't see these calls.

  • DAdd disallowed_tools=["Bash(rm *)", "Bash(git push *)"], so that the risky shell commands are blocked

    Incorrect

    Bash stays available; only calls matching those patterns are denied, and other Bash calls are approved in this mode.

allowed_tools pre-approves the tools it lists and leaves every other tool available. In bypassPermissions mode, calls to unlisted tools are approved too. Deny rules, explicit ask rules and hooks are evaluated before the mode check, so a disallowed_tools entry with a bare tool name removes that tool from the request in any mode, while a pattern such as Bash(rm *) denies only matching calls.

Question 2 · choose 2

A platform team scopes down the tools of its developers' Claude Code sessions through managed settings instead of removing them. Two calls must never run: an Agent call that asks for its own git worktree, and a Bash command started in the background. Every other Agent and Bash call keeps working as today. Which TWO deny rules do this? (Choose TWO.)

  1. A"Bash(command:* &)", which matches any shell command whose text ends by sending it to the background
  2. B"Agent(isolation:worktree)", which matches Agent calls that request a git worktree
  3. C"Bash(run_in_background:true)", which matches Bash calls that run in the background
  4. D"Agent(isolation:*)" together with "Agent(model:*)", which also match the Agent calls that leave those parameters unset
  5. E"Agent", which removes the Agent tool for every session so that no subagent can ask for a worktree again
Show the answer and why
  • A"Bash(command:* &)", which matches any shell command whose text ends by sending it to the background

    Incorrect

    A tool's primary content field, such as Bash's command, can't be matched by a parameter rule; Claude Code ignores the rule.

  • B"Agent(isolation:worktree)", which matches Agent calls that request a git worktree

    Correct

    Deny rules can match a top-level input parameter of a built-in tool, such as isolation on the Agent tool.

  • C"Bash(run_in_background:true)", which matches Bash calls that run in the background

    Correct

    run_in_background is a scalar parameter of Bash, so a parameter rule matches calls that set it to true.

  • D"Agent(isolation:*)" together with "Agent(model:*)", which also match the Agent calls that leave those parameters unset

    Incorrect

    A parameter the model omits is never matched, and these rules would also block Agent calls that the team wants to keep.

  • E"Agent", which removes the Agent tool for every session so that no subagent can ask for a worktree again

    Incorrect

    A bare tool name removes the whole tool, which breaks the Agent calls that must keep working.

Deny and ask rules can match a top-level scalar parameter on any built-in tool with Tool(param:value), such as Agent(isolation:worktree) or Bash(run_in_background:true). A parameter the model omits is never matched, and a tool's primary content field, such as command for Bash, can't be matched this way, so such a rule is ignored with a startup warning. A bare tool name removes the tool altogether.

Question 3 · choose 1

A team scopes Claude Code's web access down to its documentation site. Developers need pages on docs.example.com and on its subdomains, such as api.docs.example.com, and nothing else. The project settings allow WebFetch(domain:docs.example.com) and deny every other fetch. Fetches to api.docs.example.com now prompt or fail. What should the allow list contain?

  1. AWebFetch(domain:docs.example.*), so that the trailing wildcard covers every subdomain
  2. BWebFetch(domain:docs.example.com) and WebFetch(domain:*.docs.example.com)
  3. CWebFetch(domain:*.docs.example.com) alone, which covers the domain and all of its subdomains
  4. DA bare WebFetch allow rule, so that every fetch is approved and the deny list removes the rest
Show the answer and why
  • AWebFetch(domain:docs.example.*), so that the trailing wildcard covers every subdomain

    Incorrect

    A wildcard in that position matches only the text between two dots, such as a top-level domain.

  • BWebFetch(domain:docs.example.com) and WebFetch(domain:*.docs.example.com)

    Correct

    A domain rule matches that host only; the *. form covers subdomains at any depth but not the domain itself.

  • CWebFetch(domain:*.docs.example.com) alone, which covers the domain and all of its subdomains

    Incorrect

    The *. form matches subdomains but not docs.example.com itself.

  • DA bare WebFetch allow rule, so that every fetch is approved and the deny list removes the rest

    Incorrect

    A bare WebFetch rule covers every URL, which is broader than the scope the team wants.

Claude Code's WebFetch rules match the hostname of the requested URL. WebFetch(domain:example.com) matches example.com only; to cover subdomains, add WebFetch(domain:*.example.com), which matches any subdomain at any depth but not example.com itself. A wildcard elsewhere matches only the text between two dots.

Practice domain 3 →Practice all domains →