Redesigned model card
Browse files
README.md
CHANGED
|
@@ -2,105 +2,129 @@
|
|
| 2 |
license: other
|
| 3 |
license_name: mastyf-proprietary
|
| 4 |
language: [en]
|
| 5 |
-
tags: [agent-security, ai-safety, tool-use, guardrails, prompt-injection, mcp]
|
| 6 |
pipeline_tag: text-classification
|
| 7 |
---
|
| 8 |
|
| 9 |
-
<
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
**
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
-
my systems, and how bad could it get?"**, and answers in about 50 ms on a CPU, before anything runs.
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
M --> E["Predicted effects<br/>🔴 sends a secret off the machine 100%<br/>🔴 reads secrets 99%"]
|
| 32 |
-
M --> D["Worst case (95%)<br/>📤 up to 1.7 KB leaves"]
|
| 33 |
-
E --> S{"Shield decides"}
|
| 34 |
-
D --> S
|
| 35 |
-
S -->|safe| R["✅ runs"]
|
| 36 |
-
S -->|risky| H["⛔ pauses and asks"]
|
| 37 |
-
```
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
Every training action ran in an isolated container planted with **fake credentials** (honeytokens), with
|
| 52 |
-
**system-call tracing** and a **network trap** that also decrypts HTTPS and acts as an SSH/SFTP server. If a planted
|
| 53 |
-
key showed up on the network, over any channel, that action really leaked a secret. The model learns to predict those *observed* consequences from the action alone.
|
| 54 |
|
| 55 |
## Results
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|---|---|---|
|
| 62 |
-
| Claude Agent SDK |
|
| 63 |
-
| OpenAI Agents SDK |
|
| 64 |
-
| Google ADK
|
| 65 |
-
| mini-swe-agent
|
| 66 |
-
| OpenHands
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
|
| 69 |
-
**HTTPS, SSH and SFTP**, **98–100%** are caught, with 0–1.4% of normal look-alike network actions flagged.
|
| 70 |
-
Attacks come from held-out categories of the public DTap benchmark; benign traffic from public SWE-agent,
|
| 71 |
-
mini-swe-agent and OpenHands trajectories. All numbers are self-measured; see Limitations.
|
| 72 |
|
| 73 |
-
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
## Model details
|
| 81 |
|
| 82 |
| | |
|
| 83 |
|---|---|
|
| 84 |
-
| Architecture | Causal byte-level transformer, 39M parameters,
|
|
|
|
| 85 |
| Outputs | 39 effect probabilities, harm score, damage bounds (q95), off-task score |
|
| 86 |
-
|
|
| 87 |
-
|
|
| 88 |
| Availability | Through Mastyf Shield. **Weights are not distributed.** |
|
| 89 |
|
| 90 |
## Limitations
|
| 91 |
|
| 92 |
- **Simulated, not production, traffic.** Deployments are built from public agent traces; no live customer data yet.
|
| 93 |
-
- **Coding, shell and file-system agents are
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
what it writes back (for example a wrong treatment plan), an action model cannot see it; that needs a separate
|
| 98 |
check on the answer.
|
| 99 |
- **Fixed public attack sets.** Not yet tested against attackers who adapt to the model.
|
| 100 |
-
- **
|
| 101 |
|
| 102 |
## Acknowledgements
|
|
|
|
| 103 |
Built with public data from DTap-Bench (Apache-2.0), SWE-smith trajectories (MIT), mini-swe-agent trajectories
|
| 104 |
(MIT), DeepSWE trajectories (MIT) and NVIDIA SWE-Zero OpenHands trajectories (CC-BY-4.0). Thanks to their authors.
|
| 105 |
|
| 106 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: other
|
| 3 |
license_name: mastyf-proprietary
|
| 4 |
language: [en]
|
| 5 |
+
tags: [agent-security, ai-safety, tool-use, guardrails, prompt-injection, mcp, agents]
|
| 6 |
pipeline_tag: text-classification
|
| 7 |
---
|
| 8 |
|
| 9 |
+
<p align="center">
|
| 10 |
+
<img src="https://huggingface.co/Mastyf-Labs/foresight/resolve/main/assets/hero.svg" alt="Mastyf Foresight predicting that a curl command will send AWS credentials off the machine, and escalating" width="880"/>
|
| 11 |
+
</p>
|
| 12 |
|
| 13 |
+
<p align="center">
|
| 14 |
+
<a href="#try-it-live"><b>Try it live</b></a> ·
|
| 15 |
+
<a href="#watch-it-catch-an-attack">Watch it catch an attack</a> ·
|
| 16 |
+
<a href="#results">Results</a> ·
|
| 17 |
+
<a href="https://www.mastyf.ai/">mastyf.ai</a>
|
| 18 |
+
</p>
|
| 19 |
|
| 20 |
+
**Mastyf Foresight** reads the next tool call an AI agent wants to make (a shell command, a file write, a SQL
|
| 21 |
+
query, a URL) and predicts **what it will actually do** before it runs: which secrets it touches, whether data
|
| 22 |
+
leaves the machine, what it deletes, what it installs, and how bad it could get.
|
| 23 |
|
| 24 |
+
Most guardrails ask whether text *looks* like an attack. Foresight asks what happens if the action is allowed to run.
|
| 25 |
|
| 26 |
+
---
|
| 27 |
|
| 28 |
+
## Watch it catch an attack
|
| 29 |
|
| 30 |
+
An agent is asked to set up a project. The README it reads carries a hidden instruction. Every step is judged
|
| 31 |
+
**before it runs**, and Foresight also sees what earlier tools returned, including the planted comment.
|
| 32 |
|
| 33 |
+
<p align="center">
|
| 34 |
+
<img src="https://huggingface.co/Mastyf-Labs/foresight/resolve/main/assets/replay.svg" alt="Step-by-step replay: reading the README and installing requirements are allowed; reading the AWS credentials and posting them out are escalated; the agent is paused at step 3" width="880"/>
|
| 35 |
+
</p>
|
| 36 |
|
| 37 |
+
## What it sees in a single action
|
|
|
|
| 38 |
|
| 39 |
+
<p align="center">
|
| 40 |
+
<img src="https://huggingface.co/Mastyf-Labs/foresight/resolve/main/assets/actions.svg" alt="Six actions with their predicted effects: tests and README reads are allowed; dumping the users table, download-and-run, leaking AWS keys over HTTPS and copying an SSH key are escalated" width="880"/>
|
| 41 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
Every card is a real prediction, not a mock-up. Foresight names **39 effects**, among them reading secrets,
|
| 44 |
+
sending a secret off the machine, installing persistence, piping downloaded code into a shell, dumping a database
|
| 45 |
+
and touching cloud metadata, and gives a **95% worst-case bound** on bytes sent out, database rows exposed and
|
| 46 |
+
files deleted.
|
| 47 |
|
| 48 |
+
## How it learned
|
| 49 |
+
|
| 50 |
+
<p align="center">
|
| 51 |
+
<img src="https://huggingface.co/Mastyf-Labs/foresight/resolve/main/assets/how.svg" alt="01 Sandbox, 02 Observed labels, 03 Foresight, 04 Built for Shield" width="880"/>
|
| 52 |
+
</p>
|
| 53 |
+
|
| 54 |
+
Foresight did not learn from opinions about what looks dangerous. Each of its 85,000+ training actions was run in
|
| 55 |
+
an isolated container with planted fake credentials, system-call tracing and a network trap that also decrypts
|
| 56 |
+
HTTPS and acts as an SSH and SFTP server. If a planted key appeared on the wire, the action really leaked a secret.
|
| 57 |
+
The model learns to predict those **observed consequences** from the action and the session so far.
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
## Results
|
| 60 |
|
| 61 |
+
<p align="center">
|
| 62 |
+
<img src="https://huggingface.co/Mastyf-Labs/foresight/resolve/main/assets/results.svg" alt="Attacks caught: Claude Agent SDK 98.4%, OpenAI Agents SDK 89.8%, Google ADK 85.5%; normal sessions flagged 0.4 to 1.4%" width="880"/>
|
| 63 |
+
</p>
|
| 64 |
+
|
| 65 |
+
<details>
|
| 66 |
+
<summary><b>Full numbers and how they were measured</b></summary>
|
| 67 |
|
| 68 |
+
Simulated deployments built from public agent traces. Thresholds are set on the first half of each deployment's
|
| 69 |
+
own traffic (its burn-in) and every number is measured on the second half. Attacks come from attack categories
|
| 70 |
+
held out of training.
|
| 71 |
+
|
| 72 |
+
| Deployment | Held-out attacks caught | Normal sessions with any false alarm |
|
| 73 |
|---|---|---|
|
| 74 |
+
| Claude Agent SDK | 98.4% | 1.4% |
|
| 75 |
+
| OpenAI Agents SDK | 89.8% | 0.6% |
|
| 76 |
+
| Google ADK, never seen in training | 85.5% | 0.4% |
|
| 77 |
+
| mini-swe-agent, never seen | — | 4.7%; fresh sessions calibrated on fresh traffic: 1.0% |
|
| 78 |
+
| OpenHands, never seen | — | 3.7%; fresh sessions calibrated on fresh traffic: 0.0% |
|
| 79 |
+
|
| 80 |
+
- Attacks a sandbox confirmed did real harm: **96–100%** caught.
|
| 81 |
+
- Held-out secret leaks over **HTTPS, SSH and SFTP**: **98–100%** caught, with 0–1.4% of look-alike normal network actions flagged.
|
| 82 |
+
- Fail-safe: 2,000 fault-injected decisions and **0** cases where a model failure made a decision more permissive.
|
| 83 |
+
|
| 84 |
+
All numbers are self-measured on public data; see Limitations.
|
| 85 |
+
</details>
|
| 86 |
|
| 87 |
+
## Try it live
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
+
The interactive demo lets you type any action, or replay a whole agent session step by step.
|
| 90 |
+
The link will appear here as soon as the demo server is up. Actions are only analysed, never executed.
|
| 91 |
|
| 92 |
+
## Built for Mastyf Shield
|
| 93 |
+
|
| 94 |
+
Foresight is designed to run inside [Mastyf Shield](https://www.mastyf.ai/) as an **advisor**: it can only make a
|
| 95 |
+
decision stricter (warn or escalate), never looser, and if it errors or is slow, Shield decides without it. It
|
| 96 |
+
complements **Protocol X**, which checks the content agents read, and **Mastyf Authority**, which caps the damage
|
| 97 |
+
any account can do. Foresight checks the actions agents take, and its damage bounds (bytes out, records
|
| 98 |
+
exposed, files deleted) map onto the kinds of limits Authority enforces.
|
| 99 |
|
| 100 |
## Model details
|
| 101 |
|
| 102 |
| | |
|
| 103 |
|---|---|
|
| 104 |
+
| Architecture | Causal byte-level transformer, 39M parameters, built and trained from scratch by Mastyf Labs |
|
| 105 |
+
| Context | The whole session (2,048 bytes of history), the user's task, and digests of earlier tool outputs |
|
| 106 |
| Outputs | 39 effect probabilities, harm score, damage bounds (q95), off-task score |
|
| 107 |
+
| Tools covered | Shell, file read, write and edit, search, URLs, SQL, code execution |
|
| 108 |
+
| Speed | About 50 ms per decision on a laptop CPU; an int8 version runs on small servers |
|
| 109 |
| Availability | Through Mastyf Shield. **Weights are not distributed.** |
|
| 110 |
|
| 111 |
## Limitations
|
| 112 |
|
| 113 |
- **Simulated, not production, traffic.** Deployments are built from public agent traces; no live customer data yet.
|
| 114 |
+
- **Coding, shell and file-system agents are covered best.** Business-tool domains it has never seen, for example
|
| 115 |
+
an HR or healthcare application, are not yet reliable; this is the focus of the next version.
|
| 116 |
+
- **Harm only in the final answer is out of scope.** If every tool call is legitimate and the harm is in what the
|
| 117 |
+
agent writes back, for example a wrong treatment plan, an action model cannot see it; that needs a separate
|
|
|
|
| 118 |
check on the answer.
|
| 119 |
- **Fixed public attack sets.** Not yet tested against attackers who adapt to the model.
|
| 120 |
+
- **Calibrate per deployment.** Thresholds must be set on the customer's own recent traffic.
|
| 121 |
|
| 122 |
## Acknowledgements
|
| 123 |
+
|
| 124 |
Built with public data from DTap-Bench (Apache-2.0), SWE-smith trajectories (MIT), mini-swe-agent trajectories
|
| 125 |
(MIT), DeepSWE trajectories (MIT) and NVIDIA SWE-Zero OpenHands trajectories (CC-BY-4.0). Thanks to their authors.
|
| 126 |
|
| 127 |
+
<p align="center">
|
| 128 |
+
<img src="https://huggingface.co/Mastyf-Labs/foresight/resolve/main/assets/logo_badge.png" alt="Mastyf" width="48"/><br/>
|
| 129 |
+
<sub><b>Mastyf Labs</b> · perimeter security for AI · supported by the IIT Kharagpur Seed Fund</sub>
|
| 130 |
+
</p>
|