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
2 changes: 2 additions & 0 deletions CHAGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Keep proposed and unmerged changes out of released sections.

## [Unreleased]

- Proposed Rust sandbox web route learning ([#1221](https://github.com/BitterSecurity/Decepticon/pull/1221), stacked on [#1220](https://github.com/BitterSecurity/Decepticon/pull/1220)): port the per-host JSON route store, 30-day expiry, 500-entry cap, success counts and failure strikes. The active Python sandbox engine and Docker image remain in use; no user data migration or OSS release is required. [Local comparison and verification](docs/verification/rust-sandbox-web-learning-20261205.md).

- Proposed Rust sandbox web policy core ([#1220](https://github.com/BitterSecurity/Decepticon/pull/1220)): add a standalone local library for URL transforms, SSRF/redirect policy, WAF detection, allowlisted search parsing and response validation. The current Python sandbox engine and Docker image remain in use, so users need no migration step and existing behavior is unchanged. No OSS package version or release is assigned. [Local verification and remaining integration](docs/verification/rust-sandbox-web-core-20261205.md).

- Proposed per-run proxy credential correction ([#1211](https://github.com/BitterSecurity/Decepticon/pull/1211)): preserve selected-model streaming, usage, token limits, retry/timeout settings, vendor protocol subclasses and HTTP transports when binding an engagement key. Refuse dispatch if an explicit key cannot be bound instead of silently using the environment account; requests without a per-run key are unchanged. No package version, publication or deployment. [Verification and compatibility](docs/verification/proxy-key-transport-20261120.md).
Expand Down
43 changes: 43 additions & 0 deletions docs/verification/rust-sandbox-web-learning-20261205.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Rust sandbox web learning store verification

Source baseline: Decepticon OSS `6b15092d`,
`packages/decepticon/decepticon_sandbox/web/learning.py`. The new Rust module
is `runtime/sandbox-web/src/learning.rs` and stays outside the active sandbox
image. This PR is a proposed library port, with no release or Python removal.

The Python CLI starts a fresh process for each web request. Two Rust shapes were
considered. Free functions could pass a path through every call. A
`LearningStore` owns that path and the TTL and entry limits, while each method
reloads the JSON file. The latter keeps the per-call file behavior and gives
future sandbox callers one configuration point. The store accepts a path from
its caller; it does not verify the engagement workspace. That check belongs to
the Rust command entry point when it is ported.

With Python's clock fixed at `2026-12-05T00:00:00+00:00`, direct source calls
recorded these cases:

| Case | Python result | Rust check |
| --- | --- | --- |
| URL `https://User:Pass@Example.COM:443/path?x=1`, mobile | `user:pass@example.com:443::mobile` | `python_recorded_keys_and_failure_classes` |
| Same route recorded twice | `wins=2`, `consecutive_fails=0` | `python_recorded_wins_and_failure_strikes` |
| Transient failure, then two real blocks | `0`, `1`, then entry removed | `python_recorded_wins_and_failure_strikes` |
| 31-day-old entry, invalid timestamp and two recent entries with cap 2 | `unknown::desktop`, `today::desktop` retained | `python_recorded_ttl_and_lru` |
| Timestamp with 123000 microseconds | `2026-12-05T00:00:00.123000+00:00` | `timestamp_keeps_python_microsecond_width` |

The Rust store accepts the Python JSON format. It writes sorted keys through
a unique temporary file and replaces the destination. Like the Python source,
a corrupt or unreadable file reads as an empty store and a failed write does
not fail the fetch. Concurrent process writes can still lose one update; the
active Python store has the same limitation.

Local gate on 2026-12-05:

- `cargo +1.100 fmt --manifest-path runtime/sandbox-web/Cargo.toml --check` passed.
- `bash /home/catow/.local/bin/with-build-slot cargo +1.100 test --locked --offline --manifest-path runtime/sandbox-web/Cargo.toml --all-targets` passed: 31 library tests and five learning integration tests.
- `bash /home/catow/.local/bin/with-build-slot cargo +1.100 clippy --locked --offline --manifest-path runtime/sandbox-web/Cargo.toml --all-targets -- -D warnings` passed.
- `git diff --check` passed.

These checks cover the library and source-recorded behavior. The sandbox image
still uses Python learning and Python fetch execution. Rust transport, fetch
chain, browser fallback and the CLI envelope must be ported and tested before
the image can switch to the Rust binary.
1 change: 1 addition & 0 deletions runtime/sandbox-web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
Loading