Question 30
Domain 4Situation: In your system design, you gave the document analysis agent access to a general-purpose tool fetch_url so it could download documents by URL. Production logs show this agent now frequently downloads search engine results pages to perform ad hoc web search—behavior that should be routed through the web-search agent—causing inconsistent results. Which fix is most effective? Which fix is most effective?
Correct answer: A
Explanation
A document analysis agent should only ingest documents, so the tool should be constrained to document URLs rather than arbitrary web pages. Replacing "fetch_url" with a "load_document" tool that "validates that URLs point to document formats" prevents search engine results pages from being downloaded and keeps web search routed through the web-search agent.
Why each option is right or wrong
A. Replace fetch_url with a load_document tool that validates that URLs point to document formats.
The issue is a tool-scope violation: the agent is being allowed to retrieve arbitrary web pages, so it can bypass the intended routing and ingest search results pages instead of documents. Constraining the interface to a document-only loader that checks the URL’s content type/format before download is the most effective control, because it blocks non-document pages at the tool boundary rather than trying to correct behavior after retrieval.
B. Remove fetch_url from the document analysis agent and route all URL fetching through the coordinator to the web-search agent.
Centralizing all URL fetches adds coordination overhead and removes legitimate direct document-loading capability.
C. Implement filtering that blocks fetch_url calls to known search engine domains while allowing other URLs.
Domain blocking is brittle; search-like pages can appear on many domains, not just known engines.
D. Add instructions to the document analysis agent prompt that fetch_url should only be used to download document URLs, not to search.
Prompt instructions alone are weaker than hard tool constraints and often fail under ambiguous inputs.