Skip to main content

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.

Metadata

Release files for superred-optimizer-minja 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for superred-optimizer-minja 0.1.0
File Size Uploaded Provenance
superred_optimizer_minja-0.1.0.tar.gz 56.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for superred-optimizer-minja 0.1.0
File Interpreter ABI Platform
superred_optimizer_minja-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 103.9 kB

Release files / superred_optimizer_minja-0.1.0.tar.gz

Download URL superred_optimizer_minja-0.1.0.tar.gz
Size 56.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d49c14531cb70fca11fe8ddf10f2849c6914d7914018dc486b96245709f32334
BLAKE2b-256 checksum
How to use checksums
f7af20880759d233cd1240c39b1653df48712eef7ec1c12957c8c398846d6ddb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / superred_optimizer_minja-0.1.0-py3-none-any.whl

Download URL superred_optimizer_minja-0.1.0-py3-none-any.whl
Size 47.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba22bdeec751141b02f06cc033bab724fcb47c05cecd171149ce3c97718f3266
BLAKE2b-256 checksum
How to use checksums
83baae11540e4712623da9c8f110a76508edf73fa194fe70d138fc8cdeecb975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Security for superred-optimizer-minja 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for superred_optimizer_minja-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page