Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,33 @@ below).

## [Unreleased]

### BREAKING

- **`Agent` is now an `LLM` with `hasAgentCapabilities=True`.** It used to be
a separate `Asset` subclass. `Agent("x")` and
`LLM("x", hasAgentCapabilities=True)` are now equivalent and match the same
threats. Existing `Agent` elements therefore inherit the `LLM` attributes
and their defaults (`isThirdParty`, `processesUntrustedInput` and
`hasSystemPrompt` are `True`), so they start matching `LLM` threats: with
default attributes that means `LLM01` and `LLM07`. `usesExternalTools` and
`validatesToolLaunchConfig` moved from `Agent` to `LLM`, and `LLM09` now
targets `LLM` so it also applies to an `LLM` that uses external tools.

### Added

- Thirteen threats, `AG01` to `AG13`, derived from the OWASP Top 10 for
Agentic Applications 2026 (ASI01 to ASI08): goal hijack via untrusted
content, over-privileged or unbounded tool use, tool invocation without
per-action authorization, confused deputy between agents, credential
inheritance across delegation, unverified agentic components, impersonated
or tampered third-party endpoints, model output executed without
sanitization or sandbox, memory and context poisoning, cross-session or
cross-tenant memory bleed, spoofed or tampered inter-agent messages,
inter-agent message replay, and agent feedback loops without a circuit
breaker. Each applies only where an `LLM` with `hasAgentCapabilities=True`
is involved. ASI09 (human-agent trust) and ASI10 (rogue agents) are not
covered; they need attributes the model does not have yet.

## [1.4.1] - 2026-10-31

### BREAKING
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ The *stale_days* argument tries to determine how far apart in days the model scr

Currently available elements are: TM, Element, Server, ExternalEntity, Datastore, Actor, Process, Dataflow, Boundary, Lambda, LLM and Agent.

An `Agent` is an `LLM` whose `hasAgentCapabilities` is `True`: `Agent("Planner")` and `LLM("Planner", hasAgentCapabilities=True)` describe the same element and match the same threats. The agentic threats (`AG01` to `AG13`, based on the [OWASP Top 10 for Agentic Applications 2026](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/)) apply wherever an `LLM` with that flag is involved.

The available properties of an element can be listed by using `--describe` followed by the name of an element:

```text
Expand Down Expand Up @@ -615,6 +617,19 @@ LLM07 - Jailbreaking and Safety Bypass
LLM08 - Sensitive Information Disclosure Through Output
LLM09 - Untrusted Tool Launch Configuration
LLM10 - Personal Data Retained by Third-Party LLM Provider
AG01 - Agent Goal Hijack via Untrusted Content
AG02 - Over-Privileged or Unbounded Tool Use
AG03 - Tool Invocation Without Per-Action Authorization
AG04 - Confused Deputy Between Agents
AG05 - Credential Inheritance Across Agent Delegation
AG06 - Unverified Agentic Components
AG07 - Impersonated or Tampered Third-Party Tool or Agent Endpoint
AG08 - Model Output Executed Without Sanitization or Sandbox
AG09 - Agent Memory and Context Poisoning
AG10 - Cross-Session or Cross-Tenant Memory Bleed
AG11 - Spoofed or Tampered Inter-Agent Message
AG12 - Inter-Agent Message Replay
AG13 - Agent Feedback Loop Without Circuit Breaker


```
78 changes: 28 additions & 50 deletions pytm/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,56 +287,6 @@ def __init__(self, name: str = None, **data):
super().__init__(name, **data)


class Agent(Asset):
"""An agentic harness that can reason with an LLM and invoke tools.

Attributes:
port (int): Default TCP port for incoming data flows
protocol (str): Default network protocol for incoming data flows
data (DataSet): pytm.Data object(s) in incoming data flows
inputs (List[Dataflow]): Incoming Dataflows
outputs (List[Dataflow]): Outgoing Dataflows
onAWS (bool): Is this asset on AWS?
handlesResources (bool): Does this asset handle resources?
usesEnvironmentVariables (bool): Does this asset use environment variables?
OS (str): Operating system
usesExternalTools (bool): Does this agent use external tools or servers?
validatesToolLaunchConfig (bool): Does this agent validate tool/server launch configuration before execution?
"""

usesExternalTools: bool = Field(
default=False, description="Does this agent use external tools or servers?"
)
validatesToolLaunchConfig: bool = Field(
default=False,
description="Does this agent validate tool/server launch configuration before execution?",
)

def __init__(self, name: str = None, **data):
"""Initialize an Agent.

Args:
name (str): Name of the agent.
**data: Optional agent properties:
- port (int): Default TCP port for incoming data flows
- protocol (str): Default network protocol for incoming data flows
- data (DataSet): pytm.Data object(s) in incoming data flows
- inputs (List[Dataflow]): Incoming Dataflows
- outputs (List[Dataflow]): Outgoing Dataflows
- onAWS (bool): Is this asset on AWS?
- handlesResources (bool): Does this asset handle resources?
- usesEnvironmentVariables (bool): Does this asset use environment variables?
- OS (str): Operating system
- usesExternalTools (bool): Does this agent use external tools or servers?
- validatesToolLaunchConfig (bool): Does this agent validate tool/server launch configuration before execution?
"""
super().__init__(name, **data)

def _shape(self) -> str:
"""Get shape for DFD representation."""
return "hexagon"


class LLM(Asset):
"""A Large Language Model element, either third-party or self-hosted.

Expand All @@ -362,6 +312,8 @@ class LLM(Asset):
processesUntrustedInput (bool): Does this LLM process untrusted input?
hasRAG (bool): Does this LLM use retrieval-augmented generation?
hasFineTuning (bool): Has this LLM been fine-tuned?
usesExternalTools (bool): Does this LLM use external tools or servers?
validatesToolLaunchConfig (bool): Does this LLM validate tool/server launch configuration before execution?
"""

isThirdParty: bool = Field(
Expand Down Expand Up @@ -396,6 +348,13 @@ class LLM(Asset):
hasFineTuning: bool = Field(
default=False, description="Has this LLM been fine-tuned?"
)
usesExternalTools: bool = Field(
default=False, description="Does this LLM use external tools or servers?"
)
validatesToolLaunchConfig: bool = Field(
default=False,
description="Does this LLM validate tool/server launch configuration before execution?",
)

def __init__(self, name: str = None, **data):
"""Initialize an LLM.
Expand Down Expand Up @@ -424,9 +383,28 @@ def __init__(self, name: str = None, **data):
- processesUntrustedInput (bool): Does this LLM process untrusted input?
- hasRAG (bool): Does this LLM use retrieval-augmented generation?
- hasFineTuning (bool): Has this LLM been fine-tuned?
- usesExternalTools (bool): Does this LLM use external tools or servers?
- validatesToolLaunchConfig (bool): Does this LLM validate tool/server launch configuration before execution?
"""
super().__init__(name, **data)

def _shape(self) -> str:
"""Get shape for DFD representation."""
return "hexagon"


class Agent(LLM):
"""An agentic harness that can reason with an LLM and invoke tools.

An agent is modelled as an :class:`LLM` whose ``hasAgentCapabilities`` is
True, so ``Agent("x")`` and ``LLM("x", hasAgentCapabilities=True)``
describe the same thing and match the same threats. This class adds no
attributes of its own; it only flips that default.

Attributes:
hasAgentCapabilities (bool): Does this LLM have agent capabilities? Defaults to True.
"""

hasAgentCapabilities: bool = Field(
default=True, description="Does this LLM have agent capabilities?"
)
Loading
Loading