Enumerating Connected Tools and Services
After establishing interaction access to an AI agent, enumerate everything connected to it before attempting further exploitation. The agent's tool and service connections define the full attack surface available from this position. Each connected service is a potential pivot point — a database connection becomes a data exfiltration path, a code repository connection becomes a source code theft opportunity, a cloud API connection becomes a credential and infrastructure exposure.
Enumeration here is the equivalent of running local situational awareness commands after landing a shell. The goal is a complete map of what the agent can reach before deciding where to move next.
Extract Tool Definitions from the Application
If the application exposes a tools or capabilities endpoint, retrieve the full list of defined tools and their schemas before probing through the chat interface:
/api/tools: 200 /api/capabilities: 404 /api/functions: 404 /api/plugins: 200 /api/integrations: 200 /api/agent/tools: 401
{
"tools": [
{"name": "search_documents", "description": "Search internal Confluence wiki"},
{"name": "query_database", "description": "Query the PostgreSQL reporting database"},
{"name": "send_slack_message", "description": "Send messages to Slack channels"},
{"name": "execute_code", "description": "Run Python code in a sandboxed environment"},
{"name": "read_file", "description": "Read files from the shared network drive"}
]
}
This output reveals five distinct attack surfaces: Confluence (internal documentation), PostgreSQL (data exfiltration), Slack (internal comms and social engineering), code execution (potential RCE), and file system access (credential and config file theft). Prioritize based on access level and data sensitivity.
Enumerate via the Chat Interface
When no tools endpoint is available, enumerate through the chat interface. Ask the model directly and observe which capabilities it acknowledges:
Follow up by testing each claimed tool with a benign request to confirm it is active and functional rather than defined but disabled:
Discover Credentials and Connection Strings
Once tools are confirmed active, probe for the credentials and connection details the agent uses to connect to each service. These are often accessible through the agent's environment or configuration context:
Map Network Reachability via the Agent
Use the agent's HTTP or code execution tools to probe internal network addresses and discover services reachable from the agent's network position that are not accessible externally:
The scan results from the agent's network perspective reveal internal services not visible from outside. Each open port is a potential pivot target reachable through the agent's HTTP fetch or code execution tools.
References
-
OWASP Top 10 for LLM Applicationsowasp.org/www-project-top-10-for-large-language-model-applications (opens in new tab)
LLM06: Excessive Agency and LLM07: System Prompt Leakage covering tool enumeration and credential exposure
Was this helpful?
Your feedback helps improve this page.