Skip to content

pikit: A composable toolkit for indirect prompt injection research and evaluationpikit: A Composable Toolkit for Indirect Prompt Injection Research and Evaluation

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2609.36817· Zonghao Ying, Xiangfan Wu, Bo Yang, Huiyu Wu, Xing Zheng, Huangsheng Cheng, Xiaorong Shi, Jing Guo·Indexed by this site · 2026-09-30· Originally publishedTools

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors use pikit to evaluate indirect prompt injection on the pi agent; within the high-risk subset, all nine defenses reduce ASR.

Questions
Indirect prompt injection changes execution behavior through external content read by an agent. The authors argue that existing evaluations lack a framework that can independently combine attack wording, carriers, and defenses, making it difficult to systematically study their interactions.
Methods
pikit separates attacks, channels, and defenses into independently registered components, synthesizes inputs with craft(), executes combined evaluations with MatrixRunner, and saves prompts, event traces, sessions, and evaluation records.
Experiments and results
On the matched high-risk subset of the pi agent, the ASR of all nine defenses was lower than their respective baselines, but none dropped to zero. In offline detection, all three heuristic detectors had zero false positives; PatternDetector did not detect any poisoned samples.
Limitations and future work
The authors explicitly limit the defense observations to the evaluated agent architecture, target model, payload wording, and high-risk combinations. The target LLM is anonymous; the number of runs completed in the main text differs from the sample counts summarized in Table 1, and the paper does not explain the discrepancy.
Experimental setuppi coding agent、high-risk evaluation subset et al. · Attack Success Rate (ASR)、Precision et al.
Benchmarks
pi coding agenthigh-risk evaluation subsetbalanced 630-sample evaluation corpus
Metrics
Attack Success Rate (ASR)PrecisionRecallF1 ScoreFalse Positive Rate (FPR)
AI summaryResearchers released pikit, a composable toolkit for systematically evaluating indirect prompt injection threats, covering 13 attack methods, 16 text and file carriers, 9 defense strategies, and 3 offline detection baselines.

Researchers released pikit, a composable toolkit for systematically evaluating indirect prompt injection threats, covering 13 attack methods, 16 text and file carriers, 9 defense strategies, and 3 offline detection baselines.

Related events and news

1 events · 0 news mentions

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors separate attacks, carriers, and defenses and combine them to systematically evaluate indirect prompt injection risk in agents.

    The core question is how to independently vary attack wording, delivery carriers, and defense strategies, and uniformly evaluate their effects on agent execution behavior.

    • Risk scenario: In a normal task initiated by the user, the agent automatically reads web pages, files, emails, or logs, and contaminated content may cause it to deviate from user authorization. The authors emphasize the risk when untrusted data, sensitive context, and external communication coexist.
    • Existing evaluations: The authors believe AgentDojo and InjecAgent provide static benchmarks for tool-calling agents but lack a framework that can independently combine attacks, channels, and defenses.
    • Core observation: The authors cite previous work stating that successful attacks concentrate on a subset of attack–channel combinations, so evaluating only attacks or only carriers may miss successful pathways produced by interactions.
    • Threat model: Section 2.2 adopts a black-box setting.
      • Goal and target: The attacker aims to redirect the execution of the LLM agent through external content ingestion processes.
      • Capabilities: The attacker controls the payload wording and carrier format)Skip placing contaminated artifacts in external environments such as repositories or file systems.
      • Knowledge and adaptability: The attacker cannot see internal reasoning traces and cannot interactively adjust the payload within a single session.
      • Defense constraints: The attacker cannot tamper with or bypass the defense transformation process between external artifacts and the context window.
    • Proposed tool: pikit uses independent component registration, a unified synthesis interface, and a matrix runner to organize evaluations and saves auditable run records.
  2. What related research exists?

    The paper positions pikit's composable tool role around indirect injection risks, agent evaluation environments, and prompt defenses.

    Related work is mainly used to define risks, existing evaluations, and defense components; there is no separate Related Work section.

    Indirect prompt injection and risk conditions

    • Greshake et al. (2023) — discusses attacks on LLM-integrated applications via external content; the paper uses this to distinguish indirect injection from attacks where users directly submit attack inputs.
    • Willison (2025) — proposes the risk condition where private data, untrusted content, and external communication coexist, which the paper calls the "lethal trifecta."
    • EchoLeak; Liu et al. (2026) — the former discusses zero-click data exfiltration in Microsoft 365 Copilot, and the latter studies command execution attacks on agentic coding editors via poisoned repositories; the paper uses these as real-world risk background.

    Agent evaluation and runtime environments

    • AgentDojo; InjecAgent (both 2024) — evaluate prompt injection attacks and defenses for tool-calling agents. The authors argue that both lack a compositional framework for independently varying attack wording, vectors, and defenses.
    • DeepSeek harness; pi; OpenClaw (all 2026) — appear in the introduction as frameworks that handle untrusted repositories and have system, file, and network permissions; the actual evaluation environment in this paper is pi.
    • Ying et al. (2026) safety evaluation of the DeepSeek harness — prior work covers a combinatorial matrix of attacks, channels, vector patterns, and payloads; this paper builds on its risk characterization to focus on defense regression on high-risk combinations.

    Defenses and experimental baselines in this paper

    • Wallace et al. (2024); Hines et al. (2024) — study instruction hierarchy and spotlighting, respectively; the paper discusses these as existing mitigation ideas.
    • Baseline methods and data — this paper compares nine prevention strategies against no-defense matched runs; it also evaluates PatternDetector, LengthDetector, and RepetitionDetector on a balanced 630-sample detection corpus.

    The authors position pikit as a unified framework connecting these attack, vector, and defense primitives, with an emphasis on component composability and defense regression, rather than proposing a new attack optimization algorithm.

  3. How does the paper address this problem?

    pikit connects the entire evaluation workflow with independent component interfaces, a unified synthesis API, a matrix runner, and standardized judging.

    pikit connects tasks, attacks, channels, defenses, agents, and judges into a composable pipeline. The caption of Figure 1 explains that run results and trajectories are saved; defenses can act on prompts, system instructions, or context structure, not fixed insertion positions.

    Three-axis component interfaces

    • Attack: inject receives the original prompt context and attacker task, returns a synthesized string; it is responsible for altering the wording or structure of the injected instruction.
    • Channel: taint processes text carriers, taint_file generates file carriers. File mode supports binary or structured artifacts natively parsed by downstream tools.
    • Defense: apply transforms or hardens the prompt before reasoning; an optional instruction parameter passes trusted user intent for context-dependent defenses to re-emphasize the task.

    Registration and input synthesis

    • Component registration: decorators map names to components; after registration, they can be used in craft(), TOML configuration, and runners; the registry checks name uniqueness.
    • Unified synthesis: craft() returns a structured CraftResult, combining attacks and channels; file mode generates real carriers, which the authors use to distinguish document parsing from plain text ingestion.
    • Component catalog: the tool includes 13 attacks, 16 channels, 9 prevention strategies, and 3 offline detection baselines; attacks cover structural, obfuscation, and semantic categories.

    Combinatorial evaluation and auditing

    • Matrix runs: MatrixRunner reads configuration from TOML, performs Cartesian product evaluations over attacks, channels, defenses, and agents, then calls judges to export records.
    • Target adaptation: the tool supports six architecture types: chat, tool-calling, email triage, RAG, browser automation, and software engineering; empirical validation uses a pi coding agent.
    • Run records: saves full prompts, agent event trajectories, session transcripts, and judgment records for reviewing success and failure cases.

    Defense and detection placement

    • Prevention strategies: nine components include instruction prioritization, warnings, boundary markers, and context transformation strategies, applied to input or context before model reasoning.
    • Offline detection: three heuristic modules inspect raw ingested artifacts without modifying prompts or calling a second LLM; they use pattern, length, and repetition signals respectively.

    Success determination

    • Result categories: FULL indicates achieving the attack goal; PARTIAL indicates non-lethal effects like discussing or citing payloads; FAILURE / NOT_REACHED includes normal task completion, explicit refusal, or no payload effect.
    • ASR definition: ASR=(NFULL)/(Nvalid)×100%. The denominator excludes system timeouts and execution errors; only FULL counts as success.
    • Judges: the framework supports deterministic RuleJudge or optional LLMJudge; Figure 1 labels RuleJudge, and the empirical section does not report the specific LLM review model.
  4. What experiments did the paper conduct?

    Experimental evidence comes from regression on pi's high-risk combination defenses, as well as a balanced offline detection evaluation of 630 samples.

    Experiments focus on defense regression in a pi coding agent environment and offline performance of three heuristic detectors.

    Experimental setup

    • Tested environment: pi coding agent driven by anonymized LLM; authors state the environment is close to production use; target model name or version not reported.
    • Defense data: selected top 9 high-risk attack-channel-pattern combinations identified by baseline screening, each using all 35 payload cases; the paper does not list these 9 combinations.
    • Prevention strategies: evaluated few_shot_warning, instruction_hierarchy, spotlighting, self_reminder, instructional, delimiters, retokenization, sandwich, random_sequence_enclosure.
    • Matching protocol: each defense run is connected to the exact no-defense run via baseline_run_id. Planned 2,835 pairs, text states 2,832 completed, completion rate 99.89% (Section 4.1).
    • Judgment and metrics: ASR counts only FULL, excluding timeouts and execution errors; tool provides RuleJudge and optional LLMJudge. Specific LLM review model, human agreement, or independent repetitions not reported.
    • Detection corpus: 630 samples consist of 315 poisoned artifacts and 315 benign controls; three detectors directly inspect artifacts, reporting Precision, Recall, F1 Score, and FPR.

    Main results

    According to Table 1, the following are defense regression results for pi, anonymized LLM, high-risk matched subset; each row's baseline uses only runs paired with that strategy.

    Swipe horizontally to read the table

    Defense strategynMatched baseline ASRPost-defense ASR
    few_shot_warning3156.03%0.32%
    instruction_hierarchy3156.03%0.32%
    spotlighting3146.05%0.96%
    self_reminder3145.73%1.27%
    retokenization3156.03%2.22%
    sandwich3156.03%3.17%
    random_sequence_enclosure3146.05%3.18%
    All Defenses2,8176.00%1.69%
    • Two omitted rows: instructional and delimiters both have n=315, matched baseline ASR 6.03%, post-defense ASR 1.90% (Table 1).
    • Authors' interpretation: authors report a combined ASR relative reduction of 71.8%, arguing that strategies explicitly emphasizing instruction priority outperform structural boundary strategies on this subset; no strategy eliminated all successful attacks.
    • Figures and counts: readable numeric labels in Figure 2 align with Table 1 defense rows. Table 1 summarizes n=2,817, while text states completed runs as 2,832; the paper does not explain the discrepancy.

    Offline detection baselines

    According to Table 2, the following results are all from 630-sample corpus, 315 positive / 315 negative.

    Swipe horizontally to read the table

    DetectorPrecisionRecallF1 ScoreFPR
    PatternDetector0.00%0.00%0.00%0.00%
    LengthDetector100.00%11.11%20.00%0.00%
    RepetitionDetector100.00%17.78%30.19%0.00%
    • Detection outcomes: text reports LengthDetector detected 35 poisoned samples, RepetitionDetector detected 56; PatternDetector triggered on no poisoned samples (Section 4.2).
    • Authors' interpretation: authors consider static heuristic detection suitable as auxiliary signals, not as standalone defense boundaries. The abstract summarizes detection baselines as perfect precision, but Table 2's PatternDetector is a counterexample.
    • Figure text: Figure 3 labels x-axis detector names, y-axis Score (%), legend Precision, Recall, F1; some values use one decimal place, Table 2 is authoritative here.

    Other ablations and analyses

    • Reported scope: text does not list separate ablation or parameter analysis results; the full matrix of 13 attacks × 16 channels × 2 patterns × 35 payloads is explicitly attributed to prior work, not counted as this pi experiment.
  5. What are some points that can be further explored?

    The authors explicitly limit the observation of defense effectiveness to this architecture, target model, payloads, and high-risk combinations.

    The authors explicitly discuss the conditions under which the conclusions apply, without providing a specific follow-up experimental plan.

    Limitations and future directions noted by the authors

    • Conditions for the observations: Section 5.2 explicitly states that the observed defense performance depends on the evaluated agent architecture, target model, payload wording, and high-risk combinations.
    • Research positioning: Section 6 expresses the hope that pikit will support further agent safety research, but does not list specific follow-up methods or experimental arrangements.

    Experimental coverage

    • Target environment: Section 4 actually validates the pi coding agent, with the driving model anonymized; no model name, version, or sampling settings are reported.
    • Defense scope: Section 4.1 covers 9 high-risk combinations, 35 payload cases, and 9 prevention strategies, using a no-defense control matched by exact run ID.
    • Detection scope: Section 4.2 evaluates three heuristic detectors on a corpus of 315 poisoned artifacts and 315 benign artifacts, without invoking a second LLM.
    • Attack constraints: Section 2.2 uses a black-box setting; within a single session, payloads cannot be interactively rewritten, nor can the defense transformation pipeline be tampered with or bypassed.
    • Reported information: The paper does not report utility changes, latency, query costs, human judgment agreement, or the number of independent repetitions; the discrepancy between the number of completed runs in the main text and the sample counts summarized in Table 1 is not explained.
  6. Summarize the main content of the paper

    pikit provides composable indirect injection evaluation; this defense regression reduces ASR, but successful attacks remain.

    pikit is a composable toolkit for indirect prompt injection research, whose main contribution is organizing attacks, delivery channels, defenses, and evaluation pipelines, rather than proposing a new attack optimization algorithm.

    • Problem and approach: The authors argue that evaluating payloads or vectors in isolation cannot capture interaction risks. The toolkit synthesizes and runs combinations via independently registered components, craft(), and MatrixRunner, saving prompts, sessions, and evaluation traces.
    • Defense regression: On the high-risk matched subset of pi with an anonymized LLM, the All Defenses ASR in Table 1 dropped from 6.00% to 1.69%; the authors report a relative reduction of 71.8%.
    • Strategy differences: In the same environment, few_shot_warning and instruction_hierarchy both had post-defense ASRs of 0.32%; random_sequence_enclosure was 3.18% (Table 1). All strategies still had successful attacks.
    • Detection performance: On 315 poisoned artifacts and 315 benign artifacts, all three detectors had an FPR of 0.00%; RepetitionDetector Recall was 17.78%, and PatternDetector Recall was 0.00% (Table 2).
    • Authors' conclusions and evidence boundaries: The authors position heuristic detection as a supplementary signal and emphasize that the defense observations depend on this architecture, model, payloads, and high-risk combinations. The sample counts in Table 1 differ from the number of completed runs in the main text, which the paper does not explain.
Read originalarxiv.org