Skip to content

Add agentic threats AG01-AG13; make Agent an LLM with agent capabilities - #403

Open
izar wants to merge 1 commit into
OWASP:masterfrom
izar:feat/agentic-threats
Open

izar wants to merge 1 commit into
OWASP:masterfrom
izar:feat/agentic-threats

Conversation

@izar

@izar izar commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Add agentic threats AG01-AG13; make Agent an LLM with agent capabilities

Branch: feat/agentic-threats

Summary

  • Adds thirteen threats derived from the OWASP Top 10 for Agentic Applications 2026, covering ASI01 to ASI08.
  • Turns Agent into a thin subclass of LLM that defaults hasAgentCapabilities to True. Agent("x") and LLM("x", hasAgentCapabilities=True) are now the same thing and match the same threats.

Agent (breaking)

Agent was a separate Asset subclass with two fields of its own. It is now:

class Agent(LLM):
    hasAgentCapabilities: bool = Field(default=True, ...)
  • usesExternalTools and validatesToolLaunchConfig move from Agent to LLM, so an agentic LLM can express everything an Agent can.
  • LLM09 changes target from Agent to LLM. Its condition is unchanged.
  • Existing Agent elements inherit the LLM attributes and defaults, so they start matching LLM threats. With default attributes that is LLM01 and LLM07.

On the sample tm.py the finding count goes from 138 to 144. New findings: LLM01, LLM07, AG02 and AG06 on "Moderation Agent", AG03 on its query flow, AG09 on "SQL Database". Nothing is removed.

Threats

Every rule requires an LLM with hasAgentCapabilities is True somewhere in the condition. A plain LLM never triggers them.

SID ASI Target Fires when
AG01 01 LLM Untrusted content in, sensitive data in reach, external egress, no hasContentFiltering
AG02 02 LLM usesExternalTools without implementsPOLP or handlesResourceConsumption
AG03 02, 03 Dataflow Agent calls Server/Lambda/Process/Datastore without authorizesSource
AG04 03 Dataflow Agent to agent request without authorizesSource
AG05 03 Dataflow Credentials from agent to a plain LLM, or credentials that are not short-lived from agent to agent
AG06 04 LLM usesExternalTools without usesCodeSigning
AG07 04, 02 Dataflow Agent calls an external or out-of-scope endpoint without authenticatesDestination or providesIntegrity, or accepts a request from one without authenticatesSource or providesIntegrity
AG08 05 Dataflow Agent output to Process/Lambda whose controls lack sanitizesInput or isHardened
AG09 06 Datastore Agent-connected store without validatesInput
AG10 06, 03 Datastore Agent-connected, isShared, holds PII or sensitive data, no hasAccessControl
AG11 07 Dataflow Agent to agent without isEncrypted, authenticatesSource or providesIntegrity
AG12 07 Dataflow Agent to agent without implementsNonce
AG13 08 LLM Two agents send requests to each other and the agent has no handlesResourceConsumption

Details worth a reviewer's attention:

  • AG01 follows responses. inputs and outputs only hold forward flows, and the usual way an agent ingests untrusted content is the response to its own request (fetch a page, call a tool). The untrusted and sensitive legs therefore also look at f.response on outgoing flows. A request to an external element also counts as egress, so "agent fetches a web page and reads customer records" is enough to fire.
  • AG01 uses hasContentFiltering as the closing control, the same attribute LLM01 and LLM02 use. processesUntrustedInput=False also closes it.
  • AG13 excludes request/response pairs. It needs a forward flow in each direction.
  • Overlap. AG02 overlaps LLM05, AG07 overlaps DE01/AC05, AG10 overlaps AC02, AG11 overlaps DE01. The new entries carry agent-specific descriptions and mitigations.

Not covered

  • ASI09 (human-agent trust) needs something like a requiresHumanApproval attribute.
  • ASI10 (rogue agents) is runtime behaviour and fits better as assumptions or required controls.
  • ASI03 time-of-check/time-of-use cannot be expressed in a static model.
  • AG08 infers execution from a Process or Lambda sink, and AG09 cannot tell a memory write from a query, because the model has no attribute for either.

Tests

TestAgenticThreats in tests/test_pytmfunc.py runs every rule twice, once with Agent and once with LLM(hasAgentCapabilities=True). Each rule has a firing case, a mitigated case, and a case showing a plain LLM or a non-agent element does not trigger it. One end-to-end test builds a model, runs tm.check() and tm.resolve(), and asserts all thirteen appear in the findings. TestAgent asserts that Agent adds no fields and differs from an agentic LLM only by the default.

Full suite: 365 passed on Python 3.13. ruff check and ruff format --check pytm tests are clean. Not run on 3.11, 3.12 or 3.14 locally.

Notes

  • docs/threats.md is not regenerated. It is already behind threats.json on master (it lacks LLM01 to LLM10), so regenerating here would pull unrelated entries into the diff. make docs/threats.md brings it up to date.
  • The AG prefix is a proposal.
  • This PR does not depend on the target scope fix. AG13 is written with f.source so it works either way. Both PRs add to ## [Unreleased] in CHANGELOG.md, so whichever merges second needs a trivial conflict resolution there.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RcpzoonTku9xg2z9GSqXBj

Add thirteen threats derived from the OWASP Top 10 for Agentic
Applications 2026 (ASI01 to ASI08). Every rule keys on
LLM.hasAgentCapabilities, so it applies to any LLM carrying that flag.

Agent becomes a thin subclass of LLM that defaults hasAgentCapabilities
to True, instead of a separate Asset subclass. Agent("x") and
LLM("x", hasAgentCapabilities=True) are now equivalent and match the
same threats. usesExternalTools and validatesToolLaunchConfig move from
Agent to LLM, and LLM09 targets LLM so it covers both spellings.

Behaviour change: existing Agent elements inherit the LLM attributes
and defaults, so with default attributes they now also match LLM01 and
LLM07.

ASI09 and ASI10 are not covered; they need attributes the model does
not have yet.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RcpzoonTku9xg2z9GSqXBj
@izar
izar requested a review from colesmj as a code owner November 15, 2026 18:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants