superred-optimizer-minja
A MINJA (Memory INJection Attack) optimizer for superred agent targets.
Community port — not an official implementation. This module is an unofficial re-implementation of MINJA (Dong et al.) for superred. It is not affiliated with, endorsed by, or maintained by the original authors. See ASSUMPTIONS.md for every deliberate deviation from the paper and reference code.
MINJA poisons an LLM agent's long-term memory using only ordinary queries — no privileged access. Across a series of innocuous-looking questions it plants a "bridge" memory record that links a victim term to an attacker-chosen target. Later, when a clean victim query is asked, the agent retrieves the poisoned memory and produces the attacker's target instead.
Reference: Dong et al., "Memory Injection Attacks on LLM Agents via Query-Only
Interaction," arXiv:2503.03704
(NeurIPS 2025). Official implementation:
dsh3n77/MINJA. See
ASSUMPTIONS.md for the full paper-to-code mapping and every
deliberate departure.
Install
pip install superred-optimizer-minja
Usage
from minja_optimizer import MinjaOptimizer
# By default the scenario (victim -> target pair, bridge, questions) is derived
# from the superred goal and visible observables. Defaults inject_num=15,
# num_benign=50, test_num=30 match the official rap/minja.py.
optimizer = MinjaOptimizer()
# Supply an explicit scenario for exact custom content.
from minja_optimizer import MinjaScenario, VictimTargetPair
optimizer = MinjaOptimizer(scenario=MinjaScenario(...))
This optimizer targets agent-style targets whose memory persists across runs
within a task. Wire it into a Controller like any other superred optimizer —
see the framework's architecture overview.
License
MIT for this port's code (see LICENSE). The upstream reference
implementation, dsh3n77/MINJA, is MIT
licensed. The bundled RAP/WebShop scenario data originates from that repository;
it is credited in NOTICE and the upstream MIT copyright notice is
preserved in LICENSES/MINJA-MIT.txt. This port
reimplements the attack against superred's event model rather than vendoring
upstream runtime source.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file superred_optimizer_minja-0.1.0.tar.gz.
File metadata
- Download URL: superred_optimizer_minja-0.1.0.tar.gz
- Upload date:
- Size: 56.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d49c14531cb70fca11fe8ddf10f2849c6914d7914018dc486b96245709f32334
|
|
| MD5 |
a1660179dbcd3c1ce5d7e6eea4434d5b
|
|
| BLAKE2b-256 |
f7af20880759d233cd1240c39b1653df48712eef7ec1c12957c8c398846d6ddb
|
Provenance
The following attestation bundles were made for superred_optimizer_minja-0.1.0.tar.gz:
Publisher:
release.yml on RoldSI/superred-modules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
superred_optimizer_minja-0.1.0.tar.gz -
Subject digest:
d49c14531cb70fca11fe8ddf10f2849c6914d7914018dc486b96245709f32334 - Sigstore transparency entry: 2519628636
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@1c1cbc87f3969cd4417cb4ecbd685252ad82c185 -
Branch / Tag:
refs/tags/superred-optimizer-minja-v0.1.0 - Owner: https://github.com/RoldSI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c1cbc87f3969cd4417cb4ecbd685252ad82c185 -
Trigger Event:
push
-
Statement type:
File details
Details for the file superred_optimizer_minja-0.1.0-py3-none-any.whl.
File metadata
- Download URL: superred_optimizer_minja-0.1.0-py3-none-any.whl
- Upload date:
- Size: 47.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba22bdeec751141b02f06cc033bab724fcb47c05cecd171149ce3c97718f3266
|
|
| MD5 |
ab8ede8f97966beb761b2702fd2d37d1
|
|
| BLAKE2b-256 |
83baae11540e4712623da9c8f110a76508edf73fa194fe70d138fc8cdeecb975
|
Provenance
The following attestation bundles were made for superred_optimizer_minja-0.1.0-py3-none-any.whl:
Publisher:
release.yml on RoldSI/superred-modules
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
superred_optimizer_minja-0.1.0-py3-none-any.whl -
Subject digest:
ba22bdeec751141b02f06cc033bab724fcb47c05cecd171149ce3c97718f3266 - Sigstore transparency entry: 2519628647
- Sigstore integration time:
-
Permalink:
RoldSI/superred-modules@1c1cbc87f3969cd4417cb4ecbd685252ad82c185 -
Branch / Tag:
refs/tags/superred-optimizer-minja-v0.1.0 - Owner: https://github.com/RoldSI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c1cbc87f3969cd4417cb4ecbd685252ad82c185 -
Trigger Event:
push
-
Statement type: