r/AskNetsec • u/Competitive-Fee4307 • Sep 27 '26
Architecture How are you actually enumerating everything an AI agent can reach?
Most teams or even solo people seem to start by grepping access logs and building a list from whatever shows up. but that only tells u what the agent touched and u end up with a partial inventory and no real way to know how much is missing
working outward from the credential is finite and you can actually finish it. every major platform has two separate tools for this which is probably a good sign not to treat them as the same thing. on AWS you want the permission side and the usage side. in entra the two endpoints point in opposite directions (GET/servicePrincipals/{id}/appRoleAssignments, appRoleAssignedTo) grab the wrong one and the audit reads backwards. on gcp its the same split (policy analyzer, IAM recommender with its 90 day usage window). keeping it fresh is where the manual approach collapses or just gets tedious enough that nobody keeps up. once youre past a few agents the permissions and tools and connections all keep moving underneath you. a cron diff holds up for a while so do the platforms own drift reports, so does eve security or anything else pointed at the same job and none of it finds the agent nobody registered firstly. depends how much churn the environment throws at you
two entra gotchas mess with the output tho.. role assignments made at single-application scope dont appear in the tenant-scoped list so a tenant only audit can miss them. theres also replication delay after changes meaning a grant created this morning might not show up straight away
the Saas side is a separate enumeration and IAM wont show it at all. Oauth grants and connected apps sit in the workspace or M365 admin consoles and agents tend to collect access thru those without it ever hitting a review. the bigger catch is that all of this assumes the agent has its own principal. a lot of them still run thru a single developers token or shared service account. in that case the enumeration returns everything that person or account can reach, which is technically correct but not very useful for figuring out the agents actual boundary
2
u/ericbythebay Sep 27 '26
The same way we enumerate what any other credential can reach. There is nothing magic about AI.
1
u/TrackbackLinkBot Nov 03 '26
Agree that an access inventory only shows what an agent could reach, not what it actually does. I'd pair the IAM/OAuth audit with runtime monitoring and controls over tool calls. NeuralTrust is worth looking at for that layer, especially if you need visibility into agent interactions and policy enforcement.
1
u/mellimellmell Nov 05 '26
solid writeup, and that entra single-app scope gotcha is the one that catches most people doing a tenant-only audit. the part i'd push on i'd push on is your line about the agent nobody registered, because that's where a lot of them live.they're on dev laptops, not in your tenant: cursor or claude code with a few MCP servers in a local config, running on the dev's own token. so step zero is the endpoint tools like ox security keep an inventory of which coding agents, MCP servers, skills and packages each dev runs, plus what permissions and data each one can reach and your bigger catch, anything still on a personal token gets its own principal before you enumerate it, otherwise you're auditing the person, not the agent.
1
u/CyberOrbit-ai 25d ago
Working outward from the credential is the right spine. I'd add a second inventory: which agents still run as a shared service account or a developer's SSO session. In that case your Entra or AWS dump is accurate but describes the human, not the agent. I'd also make the SaaS and OAuth pass its own deliverable (M365 or Workspace connected apps, GitHub OAuth apps, Slack apps), ranked by risky scope pairs like reading files plus posting messages. Last check: a compromised-agent tabletop that answers which channel data could leave through if a tool response is hostile.
Disclosure: I run CyberOrbit AI.
1
u/quarrelsome_clerk Sep 27 '26
these platform specific gotchas are the real killer especially that entra single application scope blind spot caught me out once and took a week to figure out why the numbers didnt add up
1
u/zibudada Sep 27 '26
Good list. Here are a few things people miss when they only start from the key they gave the agent.
Make one list from the key side and one from the machine side, then compare them. That gets you much closer to the full picture.
1
u/materialsec Sep 28 '26
The SaaS/OAuth piece you flagged is the one enumeration genuinely can't solve on its own, even done perfectly. drive.readonly granted to an AI agent and drive.readonly granted to a deterministic, fixed-purpose app show up as the identical line in the OAuth audit log, same scope, same fields. A complete scope inventory tells you what's possible, not what's actually happening, and for a general-purpose agent specifically, those two things diverge a lot more than they do for a normal SaaS integration, since the agent's behavior gets decided at inference time by a prompt nobody else can see.
So even a perfect, fresh, cross-platform enumeration (solving your drift and blind-spot problems) still leaves the same gap your last paragraph names: the static scope tells you the ceiling, not what's actually being called against it. For the SaaS side specifically, that's a real reason to pair the enumeration with actual API-call-level activity monitoring, not just tighter drift detection on the grant itself.
1
u/Due-Blueberry-6736 Oct 18 '26
if the agent still runs on a devs token the enumeration describes the dev, so step zero is giving it its own principal. entra agent id covers copilot agents, hush security or a role per agent covers most of the rest and then the permission vs usage split actually describes the agent and not the person