# Edge kinds

> The eight things one element can do to another, reaches, calls, reads, writes, sends, grants, depends on and trusts, with an example of each in AI software.

Source: https://keryn.dev/docs/edges/edge-kinds/

Every edge has one of eight kinds. The kind says what the source does to the target, and each kind raises its own question about authority and evidence. Use the most specific one that is true: `reaches` is the fallback when nothing more precise applies.

The kinds are the same words in the code rules, the Trust Canvas and the exported graph. The Trust Canvas [reference](https://keryn.dev/docs/reference/trust-canvas/#relationship-verbs) lists how each is inferred when an edge does not state it. Whether an edge is also a [trust boundary](https://keryn.dev/docs/edges/trust-boundaries/) depends on who controls each end, not on the kind.

| Kind | The question it raises |
|---|---|
| [reaches](#reaches) | What can this affect, directly or through a chain? |
| [calls](#calls) | Who decides that it runs, and with what arguments? |
| [reads](#reads) | Does the reader have the right to what it reads? |
| [writes](#writes) | What changes, and can it be undone? |
| [sends](#sends) | What leaves, and where does it go? |
| [grants](#grants) | Who gave this authority, and can it be taken back? |
| [depends on](#depends-on) | Who controls the thing this relies on? |
| [trusts](#trusts) | What evidence supports the trust? |

## reaches

Diagram: public route reaches agent, across a trust boundary. Anything on the open internet can start a run.

The general case: the source can affect the target, and nothing more specific is known. A public route that can start an agent is the usual example. Reach is transitive, so the useful question is the whole set of things an element can affect through its edges, which the [Trust Canvas](https://keryn.dev/docs/guides/trust-canvas/) shows as the blast radius. An edge you cannot give a more specific kind to is a prompt to find out what really passes along it.

Rules that inspect this edge: 187 rules in the catalog name reaches in their metadata.

- [`keryn.agentcfg.env-api-base-url-override`](https://keryn.dev/rules/claude-code-hooks-v1/#kerynagentcfgenv-api-base-url-override)
- [`keryn.agents2026.agentcore-payload-to-browser-navigation`](https://keryn.dev/rules/agent-frameworks-2026-python-v1/#kerynagents2026agentcore-payload-to-browser-navigation)
- [`keryn.agents2026.openai-agents-function-tool-network-or-file`](https://keryn.dev/rules/agent-frameworks-2026-python-v1/#kerynagents2026openai-agents-function-tool-network-or-file)
- [`keryn.agents2026.strands-agent-dangerous-community-tool`](https://keryn.dev/rules/agent-frameworks-2026-python-v1/#kerynagents2026strands-agent-dangerous-community-tool)
- [`keryn.browseragent.host-function-exposed-to-page-js`](https://keryn.dev/rules/browser-agent-automation-v1/#kerynbrowseragenthost-function-exposed-to-page-js)
- [`keryn.browseragent.host-function-exposed-to-page-py`](https://keryn.dev/rules/browser-agent-automation-v1/#kerynbrowseragenthost-function-exposed-to-page-py)
- [`keryn.browseragent.page-content-in-system-prompt-js`](https://keryn.dev/rules/browser-agent-automation-v1/#kerynbrowseragentpage-content-in-system-prompt-js)
- [`keryn.browseragent.page-content-in-system-prompt-py`](https://keryn.dev/rules/browser-agent-automation-v1/#kerynbrowseragentpage-content-in-system-prompt-py)

179 more in the [rule catalog](https://keryn.dev/rules/).

## calls

Diagram: model output calls tool dispatch, across a trust boundary. The model chooses which function runs.

The source invokes the target: an agent calls a tool, an application calls a model, a workflow calls an MCP server. The question is who decides. When a fixed line of code calls a fixed function, the caller decides. When the text of a model's reply picks the function or its arguments, whoever can influence that text decides, and that is a boundary.

**A model's reply picks the function** (a live example on the page; the engine runs in the browser, nothing is uploaded)

```python
import tools
from anthropic import Anthropic

client = Anthropic()

def act(request):
    reply = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=100,
        messages=[{"role": "user", "content": "Name the handler for: " + request}],
    )
    name = reply.content[0].text.strip()
    handler = getattr(tools, name)
    return handler(request)
```

Rule:

```yaml
rules:
  - id: acme.model-picks-the-call
    languages: [python]
    severity: ERROR
    message: A model's reply selects which function is called. Look the name up in a fixed table instead.
    metadata:
      edge: calls
    mode: taint
    pattern-sources:
      - pattern: $CLIENT.messages.create(...)
    pattern-sinks:
      - pattern: getattr($MOD, $NAME)
```

Result, computed when the site was built by the same engine as `keryn scan`:

```text
1 finding · 1 of 1 rules ran on 1 file

error acme.model-picks-the-call line 14 [proof 2 path-in-file]
  A model's reply selects which function is called. Look the name up in a fixed table instead.
  Edge: calls
  Flow: source (line 8) -> propagation (line 8) -> propagation (line 13)
  | handler = getattr(tools, name)
```

The finding is on the edge from the reply to the lookup. Replacing `getattr` with a dictionary of the handlers you allow removes the edge.

Rules that inspect this edge: 450 rules in the catalog name calls in their metadata.

- [`keryn.agentcfg.hook-command-relative-script-path`](https://keryn.dev/rules/claude-code-hooks-v1/#kerynagentcfghook-command-relative-script-path)
- [`keryn.agentcfg.hook-command-unconditional-allow`](https://keryn.dev/rules/claude-code-hooks-v1/#kerynagentcfghook-command-unconditional-allow)
- [`keryn.agentcfg.hook-command-uses-eval`](https://keryn.dev/rules/claude-code-hooks-v1/#kerynagentcfghook-command-uses-eval)
- [`keryn.agentclient.gemini-mcp-server-trusted`](https://keryn.dev/rules/agent-client-configs-v1/#kerynagentclientgemini-mcp-server-trusted)
- [`keryn.agenthooks.copilot-hook-base64-exec`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-base64-exec)
- [`keryn.agenthooks.copilot-hook-edits-workflows`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-edits-workflows)
- [`keryn.agenthooks.copilot-hook-relative-script-path`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-relative-script-path)
- [`keryn.agenthooks.copilot-hook-uses-sudo`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-uses-sudo)

442 more in the [rule catalog](https://keryn.dev/rules/).

## reads

Diagram: agent reads file system, across a trust boundary. The path comes from the model.

The source takes data from the target: a file, a database row, a document retrieved for a prompt, a secret. Reading raises two questions. Is the reader allowed this data, and what else will the data do once it is read? Retrieved text can carry instructions, so a read into a prompt is also a way in for whatever wrote the document.

**A model's reply chooses what is read** (a live example on the page; the engine runs in the browser, nothing is uploaded)

```python
from anthropic import Anthropic

client = Anthropic()

def explain(question):
    reply = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=100,
        messages=[{"role": "user", "content": "Which file answers: " + question}],
    )
    path = reply.content[0].text.strip()
    with open(path) as handle:
        return handle.read()
```

Rule:

```yaml
rules:
  - id: acme.model-picks-the-file
    languages: [python]
    severity: ERROR
    message: A model's reply is used as a file path. Resolve it against an allowed directory first.
    metadata:
      edge: reads
    mode: taint
    pattern-sources:
      - pattern: $CLIENT.messages.create(...)
    pattern-sinks:
      - pattern: open($PATH, ...)
```

Result, computed when the site was built by the same engine as `keryn scan`:

```text
1 finding · 1 of 1 rules ran on 1 file

error acme.model-picks-the-file line 13 [proof 2 path-in-file]
  A model's reply is used as a file path. Resolve it against an allowed directory first.
  Edge: reads
  Flow: source (line 7) -> propagation (line 7) -> propagation (line 12)
  | with open(path) as handle:
```

Rules that inspect this edge: 71 rules in the catalog name reads in their metadata.

- [`keryn.agents2026.genkit-definetool-no-inputschema`](https://keryn.dev/rules/agent-frameworks-2026-ts-v1/#kerynagents2026genkit-definetool-no-inputschema)
- [`keryn.agents2026.mastra-createtool-no-inputschema`](https://keryn.dev/rules/agent-frameworks-2026-ts-v1/#kerynagents2026mastra-createtool-no-inputschema)
- [`keryn.agents2026.pydantic-ai-instrument-prompts-to-exporter`](https://keryn.dev/rules/agent-frameworks-2026-python-v1/#kerynagents2026pydantic-ai-instrument-prompts-to-exporter)
- [`keryn.gaps.tool-argument-opened-as-path`](https://keryn.dev/rules/benchmark-gaps-v1/#keryngapstool-argument-opened-as-path)
- [`keryn.general.csharp.zip-slip-entry-name`](https://keryn.dev/rules/general-injection-csharp-v1/#keryngeneralcsharpzip-slip-entry-name)
- [`keryn.general.go.zip-slip-entry-name`](https://keryn.dev/rules/general-injection-go-v1/#keryngeneralgozip-slip-entry-name)
- [`keryn.general.java.zip-slip-entry-name`](https://keryn.dev/rules/general-injection-java-v1/#keryngeneraljavazip-slip-entry-name)
- [`keryn.general.js.fs-path-not-constant`](https://keryn.dev/rules/javascript-node-security-v1/#keryngeneraljsfs-path-not-constant)

63 more in the [rule catalog](https://keryn.dev/rules/).

## writes

Diagram: agent writes database, across a trust boundary. Model text becomes a statement.

The source changes state in the target. Writes are what make a chain consequential, because they are hard to take back. The question is what a successful abuse changes and whether anything records or reverses it. A write that a person approved first is a different edge from one the model triggered alone.

**Model text becomes a statement** (a live example on the page; the engine runs in the browser, nothing is uploaded)

```python
import sqlite3
from anthropic import Anthropic

client = Anthropic()
db = sqlite3.connect("tickets.db")

def close_ticket(note):
    reply = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=100,
        messages=[{"role": "user", "content": "Write one SQL statement that closes the ticket: " + note}],
    )
    statement = reply.content[0].text
    db.execute(statement)
    db.commit()
```

Rule:

```yaml
rules:
  - id: acme.model-writes-sql
    languages: [python]
    severity: ERROR
    message: A model's reply is executed as SQL. Have the model choose among fixed, parameterised statements.
    metadata:
      edge: writes
    mode: taint
    pattern-sources:
      - pattern: $CLIENT.messages.create(...)
    pattern-sinks:
      - pattern: $DB.execute($SQL, ...)
```

Result, computed when the site was built by the same engine as `keryn scan`:

```text
1 finding · 1 of 1 rules ran on 1 file

error acme.model-writes-sql line 15 [proof 2 path-in-file]
  A model's reply is executed as SQL. Have the model choose among fixed, parameterised statements.
  Edge: writes
  Flow: source (line 9) -> propagation (line 9) -> propagation (line 14)
  | db.execute(statement)
```

Rules that inspect this edge: 68 rules in the catalog name writes in their metadata.

- [`keryn.agents2026.openai-agents-web-search-with-write-tools`](https://keryn.dev/rules/agent-frameworks-2026-python-v1/#kerynagents2026openai-agents-web-search-with-write-tools)
- [`keryn.fastapi.upload-to-llm-without-size-check`](https://keryn.dev/rules/fastapi-ai-service-v1/#kerynfastapiupload-to-llm-without-size-check)
- [`keryn.gaps.joined-path-written-unconfined`](https://keryn.dev/rules/benchmark-gaps-v1/#keryngapsjoined-path-written-unconfined)
- [`keryn.general.js.buffer-constructor-non-literal`](https://keryn.dev/rules/javascript-node-security-v1/#keryngeneraljsbuffer-constructor-non-literal)
- [`keryn.general.js.fs-destination-not-constant`](https://keryn.dev/rules/javascript-node-security-v1/#keryngeneraljsfs-destination-not-constant)
- [`keryn.general.js.plain-object-dynamic-key-write`](https://keryn.dev/rules/javascript-node-security-v1/#keryngeneraljsplain-object-dynamic-key-write)
- [`keryn.general.php.zip-extractto-uploaded-archive-audit`](https://keryn.dev/rules/general-injection-php-v1/#keryngeneralphpzip-extractto-uploaded-archive-audit)
- [`keryn.general.python.tempfile-mktemp`](https://keryn.dev/rules/general-hazards-python-v1/#keryngeneralpythontempfile-mktemp)

60 more in the [rule catalog](https://keryn.dev/rules/).

## sends

Diagram: service sends webhook host, across a trust boundary. A credential travels with the request.

The source passes content to the target, usually something outside: a prompt to a model provider, an event to a webhook, a trace to a logging service. The question is what leaves and where it goes. Sending is often the last edge of an exfiltration chain, and the content that matters most is a credential or customer data.

**A secret rides on a request** (a live example on the page; the engine runs in the browser, nothing is uploaded)

```python
import os
import requests

def report(event):
    key = os.environ["PAYMENTS_API_KEY"]
    return requests.post(
        "https://hooks.example.com/ingest",
        headers={"X-Key": key},
        json={"event": event},
    )
```

Rule:

```yaml
rules:
  - id: acme.secret-in-request
    languages: [python]
    severity: WARNING
    message: A value read from the environment is sent in an outgoing request. Check that the destination should receive it.
    metadata:
      edge: sends
    mode: taint
    pattern-sources:
      - pattern: os.environ[...]
    pattern-sinks:
      - pattern: requests.post(...)
```

Result, computed when the site was built by the same engine as `keryn scan`:

```text
1 finding · 1 of 1 rules ran on 1 file

warning acme.secret-in-request lines 7-11 [proof 2 path-in-file]
  A value read from the environment is sent in an outgoing request. Check that the destination should receive it.
  Edge: sends
  Flow: source (line 6) -> propagation (line 6)
  | return requests.post(
  | "https://hooks.example.com/ingest",
  | headers={"X-Key": key},
  | json={"event": event},
  | )
```

Rules that inspect this edge: 101 rules in the catalog name sends in their metadata.

- [`keryn.agentcfg.hook-command-dns-lookup-with-variable`](https://keryn.dev/rules/claude-code-hooks-v1/#kerynagentcfghook-command-dns-lookup-with-variable)
- [`keryn.agenthooks.copilot-hook-raw-ip-url`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-raw-ip-url)
- [`keryn.agenthooks.copilot-hook-reverse-shell`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-reverse-shell)
- [`keryn.agenthooks.copilot-hook-sends-host-data`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-sends-host-data)
- [`keryn.agenthooks.copilot-prompt-hook-posts-to-network`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-prompt-hook-posts-to-network)
- [`keryn.agenthooks.cursor-hook-raw-ip-url`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscursor-hook-raw-ip-url)
- [`keryn.agenthooks.cursor-hook-reverse-shell`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscursor-hook-reverse-shell)
- [`keryn.agenthooks.cursor-hook-sends-host-data`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscursor-hook-sends-host-data)

93 more in the [rule catalog](https://keryn.dev/rules/).

## grants

Diagram: reviewer grants agent. Approval gives the agent authority for one action.

The source gives the target authority: a person approves an action, a role is assigned, a token is issued, a tool is permitted. Grants are where control comes from, and where it is lost. The questions are who granted, for what scope and for how long, and whether the grant can be withdrawn. A grant that a model can issue to itself is no control at all. In the Trust Canvas, an approval on an edge is what breaks a [chain](https://keryn.dev/docs/edges/paths-and-chains/).

Rules that inspect this edge: 360 rules in the catalog name grants in their metadata.

- [`keryn.agentcfg.stop-hook-blocks-without-active-check`](https://keryn.dev/rules/claude-code-hooks-v1/#kerynagentcfgstop-hook-blocks-without-active-check)
- [`keryn.agentclient.codex-approval-policy-never`](https://keryn.dev/rules/agent-client-configs-generic-v1/#kerynagentclientcodex-approval-policy-never)
- [`keryn.agentclient.codex-sandbox-full-access`](https://keryn.dev/rules/agent-client-configs-generic-v1/#kerynagentclientcodex-sandbox-full-access)
- [`keryn.agentclient.gemini-auto-accept`](https://keryn.dev/rules/agent-client-configs-v1/#kerynagentclientgemini-auto-accept)
- [`keryn.agentclient.gemini-sandbox-disabled`](https://keryn.dev/rules/agent-client-configs-v1/#kerynagentclientgemini-sandbox-disabled)
- [`keryn.agentclient.skill-allowed-tools-unrestricted`](https://keryn.dev/rules/agent-client-configs-generic-v1/#kerynagentclientskill-allowed-tools-unrestricted)
- [`keryn.agentclient.vscode-chat-tools-auto-approve`](https://keryn.dev/rules/agent-client-configs-v1/#kerynagentclientvscode-chat-tools-auto-approve)
- [`keryn.agenthooks.cursor-gate-hook-always-allows`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscursor-gate-hook-always-allows)

352 more in the [rule catalog](https://keryn.dev/rules/).

## depends on

Diagram: agent depends on MCP server, across a trust boundary. A server the agent runs but does not control.

The source relies on the target being what it claims: a package, a base image, a model file, an MCP server started from a registry name. The question is who controls the thing relied on, and whether the version is pinned so that what you tested is what runs. A dependency edge crosses a boundary when its target is outside your control, which is the supply-chain class in [trust boundaries](https://keryn.dev/docs/edges/trust-boundaries/).

Rules that inspect this edge: 253 rules in the catalog name depends_on in their metadata.

- [`keryn.agenthooks.copilot-hook-pipes-download-to-shell`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-pipes-download-to-shell)
- [`keryn.agenthooks.copilot-hook-unpinned-package-runner`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscopilot-hook-unpinned-package-runner)
- [`keryn.agenthooks.cursor-hook-pipes-download-to-shell`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscursor-hook-pipes-download-to-shell)
- [`keryn.agenthooks.cursor-hook-unpinned-package-runner`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookscursor-hook-unpinned-package-runner)
- [`keryn.agenthooks.gemini-hook-pipes-download-to-shell`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthooksgemini-hook-pipes-download-to-shell)
- [`keryn.agenthooks.gemini-hook-unpinned-package-runner`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthooksgemini-hook-unpinned-package-runner)
- [`keryn.agenthooks.kiro-broad-file-hook-fetches`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookskiro-broad-file-hook-fetches)
- [`keryn.agenthooks.kiro-hook-pipes-download-to-shell`](https://keryn.dev/rules/agent-hooks-multivendor-v1/#kerynagenthookskiro-hook-pipes-download-to-shell)

245 more in the [rule catalog](https://keryn.dev/rules/).

## trusts

Diagram: agent trusts retrieved text, across a trust boundary. Retrieved content is treated as instructions.

The source accepts the target without checking it. This is the edge to write down when trust is a decision rather than a side effect: an agent treats the contents of a document as instructions, a service accepts a header as proof of identity, a build accepts an artifact from a cache. The question is what evidence supports the trust, and the useful answer is a file, a test or a review that a reader can open. Where no evidence exists, the Trust Canvas flags a boundary that is crossed with nothing recorded on it.

Rules that inspect this edge: 67 rules in the catalog name trusts in their metadata.

- [`keryn.canon.go.validate-before-decode`](https://keryn.dev/rules/canonicalization-order-v1/#keryncanongovalidate-before-decode)
- [`keryn.canon.php.validate-before-decode`](https://keryn.dev/rules/canonicalization-order-v1/#keryncanonphpvalidate-before-decode)
- [`keryn.canon.py.validate-before-decode`](https://keryn.dev/rules/canonicalization-order-v1/#keryncanonpyvalidate-before-decode)
- [`keryn.canon.ts.validate-before-decode`](https://keryn.dev/rules/canonicalization-order-v1/#keryncanontsvalidate-before-decode)
- [`keryn.config.jwt-algorithm-none`](https://keryn.dev/rules/agent-security-config-v1/#kerynconfigjwt-algorithm-none)
- [`keryn.cryptoclaim.cs.ecb-mode-for-claims`](https://keryn.dev/rules/crypto-claim-integrity-v1/#keryncryptoclaimcsecb-mode-for-claims)
- [`keryn.cryptoclaim.cs.jwt-verification-disabled`](https://keryn.dev/rules/crypto-claim-integrity-v1/#keryncryptoclaimcsjwt-verification-disabled)
- [`keryn.cryptoclaim.go.ecb-mode-for-claims`](https://keryn.dev/rules/crypto-claim-integrity-v1/#keryncryptoclaimgoecb-mode-for-claims)

59 more in the [rule catalog](https://keryn.dev/rules/).

## The rules for an edge

Each section above ends with the rules whose metadata names that edge, once the rule catalog carries it. The same appears for each class on [trust boundaries](https://keryn.dev/docs/edges/trust-boundaries/). The examples here are small rules written for these pages. They show what an edge looks like to the engine; they are not the catalog's rules.
