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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superred_optimizer_minja-0.1.0.tar.gz (56.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superred_optimizer_minja-0.1.0-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

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

Hashes for superred_optimizer_minja-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d49c14531cb70fca11fe8ddf10f2849c6914d7914018dc486b96245709f32334
MD5 a1660179dbcd3c1ce5d7e6eea4434d5b
BLAKE2b-256 f7af20880759d233cd1240c39b1653df48712eef7ec1c12957c8c398846d6ddb

See more details on using hashes here.

Provenance

The following attestation bundles were made for superred_optimizer_minja-0.1.0.tar.gz:

Publisher: release.yml on RoldSI/superred-modules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file superred_optimizer_minja-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for superred_optimizer_minja-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba22bdeec751141b02f06cc033bab724fcb47c05cecd171149ce3c97718f3266
MD5 ab8ede8f97966beb761b2702fd2d37d1
BLAKE2b-256 83baae11540e4712623da9c8f110a76508edf73fa194fe70d138fc8cdeecb975

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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