Flowsh: An information flow control shell for AI agentsFlowsh: An Information Flow-Controlled Shell for AI Agents
The authors propose an information flow control shell, FLOWSH; the authors report that it reduces approvals compared with Lax sandbox and achieves 0% B-ASR in a no-approval setting.
The agent configuration, system messages, tool descriptions and LLM are trusted and known to the attacker; at runtime the attacker cannot directly observe or tamper with LLM queries and responses, but can observe some tool calls and shell execution effects and tamper with some tool return data. The evaluation additionally sets up a Byzantine adversary: after the payload enters the model input, it fully controls the model output.
- The shell lets agents operate on files and the network and execute code, and also brings prompt injection, file-destruction and data-leakage risks. The authors consider that human or AI approval can err, while static sandboxes struggle to balance safety and task utility.
- FLOWSH does not predict command effects in advance; instead it uses Bubblewrap, eBPF, a MITM proxy and OverlayFS to monitor actual inputs and effects, propagating and persisting IFC labels; safe flows execute automatically, and violating flows enter approval or are blocked.
- On GPT-6.2 Sol, 17 knowledge tasks and Terminal-Bench 2.0, the authors report that FLOWSH reduces approvals relative to Lax; without approval, the knowledge attack B-ASR is 0%, but TCR is lower than Lax, and runtime and tokens increase.
- The authors state that whether approval information improves human or AI decisions has not been verified, and point out limitations such as coarse-grained labels, background processes and cross-command IPC, and UDP/QUIC. The experiments use only GPT-6.2 Sol, knowledge tasks use a mock environment, and the paper does not report the specific model of the LLM judge.
- Evaluated models
- GPT-6.2 Sol
- Metrics
- TCRapproval requests per completed taskB-ASRexecution timetokensLLM calls
The researchers propose Flowsh, an information flow control (IFC) shell for AI agents, to prevent file damage and data exfiltration caused by prompt injection or goal pressure on agents. Existing approaches either rely on human or AI model approval, which is error-prone, or use static sandboxes, which limit utility or provide insufficient security; Flowsh instead uses dynamic runtime monitoring, monitoring the file system through eBPF and OverlayFS and the network through a man-in-the-middle proxy, maintaining information flow labels for the context and updating them with observed inputs, tracking IFC metadata across command execution and persistent files, and enforcing policies on the effects of shell commands. This mechanism ensures that critical operations are not affected by untrusted data (preventing prompt injection) and that data does not flow to unauthorized readers (preventing exfiltration and oversharing), blocking or requesting approval only when it cannot guarantee this. In evaluations on Terminal-Bench and a curated set of real-world scenarios, agents equipped with Flowsh reduced approval requests by 5-23 times compared with sandboxes while maintaining utility, and ensured that every unsafe operation requests approval.
Related events and news
1 events · 0 news mentions
- This event's paper
Flowsh:面向AI智能体的信息流控制shell
Paper analysis
What problem does this paper attempt to solve?
Constrain the actual effects of the shell with dynamic IFC, blocking unsafe information flows while reducing approvals.
Core problem: how to let agents use the shell safely and autonomously without relying on per-command approval or static sandboxes.
- Risk scenarios: The shell provides file, network and code execution capabilities; the authors point out that indirect prompt injection can drive agents to overwrite protected files or leak secrets, and that goal pressure and model errors can also cause similar consequences.
- Shortcomings of approval: The authors cite an Anthropic report stating that users approve about 93% of Claude Code permission prompts, and that attention decreases as prompts accumulate; the authors consider that AI approval likewise errs and cannot guarantee safety.
- Shortcomings of static sandboxes: The authors consider that safety depends on when and how resources are used, not only on which objects are accessed; a static allowlist may allow requests carrying secrets, or block safe access needed to complete the task.
- Core observation: Shell command effects depend on the dynamic execution context and are hard to predict reliably in advance; therefore file and network inputs should be observed during execution, labels joined into the shell context, and IFC policy enforced before file or network effects occur.
- Proposed system: FLOWSH combines Bubblewrap, eBPF, a MITM proxy, OverlayFS and inode extended attributes, supporting effect checking, approval, and label persistence across commands and sessions.
- Threat model:
- Goal: The injection attacks in the evaluation attempt to break the integrity of protected files or send H data to attacker-controlled destinations.
- Knowledge: The agent configuration, system messages, tool descriptions and LLM are trusted and known to the attacker.
- Capabilities: The attacker cannot directly observe or tamper with LLM queries and responses, but can observe some tool effects and tamper with some tool return data.
- Victim system and strong attack setting: The victim is an agent loop with tools such as the shell; the Byzantine adversary fully controls the model output after the payload enters the model input.
What related research exists?
Related work is divided into agent IFC, traditional shell IFC and shell protection; this paper extends IFC to command execution effects.
Agent-level IFC
- FIDES, PFI, CaMeL: use a dual-LLM pattern to isolate information and track flows, restricting consequential actions influenced by untrusted data via deterministic policies, or preventing confidential flows to public endpoints.
- Permissive information-flow analysis, RTBAS: the former excludes inputs not expected to affect the next output, while the latter sets an agent context label and removes more restrictive inputs; the authors position them as orchestrator-level controls, whereas FLOWSH extends to shell tools.
Traditional OS and shell IFC
- Flume, LOMAC, etc.: early systems provide OS-level IFC, some of which require modifying the OS; LOMAC focuses on integrity and is not aimed at AI agents.
- Comparison with Flume: the paper notes that Flume conservatively enforces policy when reading inputs, e.g., blocking reading of confidential files when a public network channel is open; FLOWSH defers checks until the actual effect occurs.
Other agent shell protections
- OpenShell, Strands Box, nono, YoloFS: respectively provide static file and network restrictions, a shell interpreter and network proxy, file-effect rollback, and file-change staging with path-based sensitive access control.
- DualView: maintains file copies in AgentView and replaces untrusted data with variables; the paper notes it has no system-level monitoring or IFC enforcement.
- Tether, ActPlane: use strace and eBPF, respectively, to monitor system execution and enforce DSL policies; the paper notes that neither describes how file labels persist across sessions or monitor restarts, nor an agent approval workflow that allows policy exceptions.
Experimental baselines and benchmarks
- Baselines: Lax, Standard, and Strict sandboxes, plus Naive IFC, which conservatively labels shell and file tool outputs as (U, H) and requires approval for every shell command.
- Benchmarks: Terminal-Bench 2.0 and self-built knowledge tasks. The authors state that AgentDojo's tasks do not require a shell, Terminal-Bench contains no knowledge-task attacks, IssueTrojanBench does not cover other knowledge tasks, and some DTap attacks do not fit this paper's threat model, hence the self-built tasks.
The authors position this paper as: extending agent-level IFC to the actual execution and effects of the shell, while providing label persistence and an approval workflow.
How does the paper address this problem?
FLOWSH aggregates input labels during execution and enforces IFC checks on staged file changes and pending network requests.
The overall approach is to not predict shell command effects, but observe inputs during controlled execution, propagate labels, and check policy before effects take place. FLOWSH lets safe flows take effect automatically and hands violating file changes or network destinations to the approval process.
Labels, policies and formalization
- Label lattice: Integrity uses T (trusted) and U (untrusted), and confidentiality uses reader sets; L denotes public, and H denotes a non-public reader set. The label scheme only needs to define a partial order, join and top, and users can configure it in Python.
- Two kinds of policies: Integrity policies require the action context and related arguments to all be T; confidentiality policies require the data's reader set to include all recipients. The configuration can also use (T, H) to support what the authors call robust declassification.
- Shell context:
\ell_{sh}(c)=\ell_{ctx}\sqcup\ell_{arg}\sqcup\bigsqcup_{f\in F(c)}\ell(f)\sqcup\bigsqcup_{e\in E(c)}\ell(e), i.e., the command context is the join of the labels of the agent context, optional arguments, accessed files and connected network endpoints. - Effect determination: For a file path or network origin mapped to label ℓ, information flow is allowed when ℓsh ⊑ ℓ; access to the sandbox blocklist is blocked regardless of IFC labels.
Isolated execution and input monitoring
- Bubblewrap sandbox: Each command runs in a separate sandbox and cgroup, with the file system mounted according to configuration; the network namespace has only loopback, external traffic must go through the MITM proxy, IPC to the host is prohibited, and child processes inherit the restrictions.
- eBPF file monitoring: Inodes are read from kernel hooks, and file reads, executions and directory-name accesses are recorded at inode granularity; opening an entire file read-only is also conservatively counted as a read, and files newly created by this command that have no label yet are filtered out.
- Monitoring buffer: The implementation uses a 64 MiB ring buffer, pausing the sandbox process when it reaches 75% and resuming after reading down to 25%; if recording still fails, the top label is added to the shell context.
- Network input: The MITM proxy identifies the source before the shell receives data; HTTP(S) is labeled by scheme, host and port, and other TCP by host and port, with the same endpoint not distinguished by URL path or response content.
Label propagation and persistence
- Initialization and update: The shell context is initialized from the agent context label and the optional argument label; when there are no variables there is no argument label, and agents without IFC use the configured default context label.
- Output labels: After the command ends, stdout, stderr and created or modified files use the final shell context label; when modifying an existing file, its original label is also joined.
- File persistence: File content and the file name in the parent directory maintain labels separately, stored in inode extended attributes; hard links etc. outside the same path also share labels, and label xattrs written by the shell itself are removed.
- Conservativeness: All inputs that may affect output are joined, including files opened but not read; read and write order within a command is not distinguished, so labels of inputs that did not actually affect a given effect may also be propagated.
File and network effects, approval
- File effects: OverlayFS stages creations, modifications and deletions, and the command can read its own staged versions; after the command ends, checks are performed against the final shell context, and only allowed or approved changes are applied to the Host FS, otherwise all are discarded.
- Whole-command approval: One approval or rejection covers all file changes of a command, even if only some files violate; the authors' stated reason is that applying only some changes may leave an inconsistent state.
- Network effects: Each request is checked before forwarding using the labels computed from the inputs observed at that time; violating requests are not sent, HTTP returns 403, TCP closes the connection, and the command continues running.
- Subsequent retries: The command result includes the blocked destinations and an approval ID; the agent can carry the ID in the next shell invocation, and after approval the corresponding information flow is allowed only in that command; if all are rejected, the command does not run.
Implementation and evaluation determination
- Prototype components: A Python shell tool with IFC logic, an eBPF monitor, and a mitmproxy integration, running on Ubuntu 26.04 LTS and requiring Bubblewrap 0.11 or higher; the agent harness uses GitHub Copilot SDK 1.0.4 and libflowsh.
- Task determination: Knowledge tasks use deterministic checks and, when necessary, an LLM judge; Terminal-Bench uses the task's own evaluator. TCR is the proportion of runs in which every user prompt passes the evaluator.
- Attack determination: B-ASR counts only successful and blocked attacks, excluding attacks where the payload never reached the model; security-aligned uses the ideal approver, and autonomy-aligned issues no approvals.
What experiments did the paper conduct?
The experiments compare five defenses on approvals, TCR, B-ASR, and overhead, and analyze labels, failure causes, and performance without approval.
Experimental setup
- Workloads: 17 self-built knowledge tasks and 89 shell tasks from Terminal-Bench 2.0; 19 prompt injection attack tasks constructed from 11 knowledge tasks that require reading U data.
- Model and repetitions: All tasks use GPT-6.2 Sol, and each defense and setting is run three times. Knowledge tasks allow at most 100 tool calls per run with a total budget of 600 seconds; Terminal-Bench uses the benchmark's own budget.
- Defenses: FLOWSH, Lax, Standard, Strict sandbox and Naive IFC; FLOWSH's sandbox allows all reads, writes and network, with effects restricted by the IFC policy.
- Two approval settings: security-aligned initiates approval for tool calls that cannot be guaranteed safe, and the ideal approver rejects calls affected by the attack payload and approves the rest; autonomy-aligned initiates no approval.
- Metrics: TCR, average number of approvals per completed task, B-ASR; shell invocation latency, end-to-end execution time, tokens and LLM calls are also measured.
- Evaluation environment: Knowledge tasks run in mock webpages and MCP servers, simulating Microsoft WorkIQ and the GitHub MCP server; the paper does not state the specific model of the LLM judge used for knowledge tasks.
Main results
According to Table 2, all use GPT-6.2 Sol; Appr. is the average number of approvals per completed task, and Appr.† in the attack column is the average number of approvals per attack.
Swipe horizontally to read the table
Defense Setting Knowledge TCR / Appr. Knowledge attack B-ASR / Appr.† Terminal-Bench TCR / Appr. Lax security-aligned 96.1% / 6.7 0.0% / 4.1 77.5% / 9.7 Standard security-aligned 76.5% / 5.7 0.0% / 3.5 64.4% / 10.0 Strict security-aligned 47.1% / 0.0 0.0% / 0.0 1.9% / 0.0 Naive IFC security-aligned 60.8% / 1.8 0.0% / 1.7 67.8% / 9.4 FLOWSH security-aligned 88.2% / 1.2 0.0% / 1.2 67.8% / 0.4 Lax autonomy-aligned 94.1% / 0 100.0% (51/51) 77.9% / 0 Standard autonomy-aligned 76.5% / 0 7.7% (3/39) 64.8% / 0 Strict autonomy-aligned 47.1% / 0 0.0% (0/39) 2.2% / 0 Naive IFC autonomy-aligned 35.3% / 0 0.0% (0/32) 21.3% / 0 FLOWSH autonomy-aligned 58.8% / 0 0.0% (0/40) 61.8% / 0 - Approvals and utility: The authors report that relative to Lax, FLOWSH reduces approvals by 5.8× and 22.5× on knowledge tasks and Terminal-Bench respectively, with TCR lower by 7.9 and 9.7 percentage points respectively; Strict has fewer approvals but also lower TCR.
- Approvals under attack: Among the 45 FLOWSH attack runs in which the payload reached the model, 39 did not request approval for prior safe operations, and the first approval targeted the attack; the authors consider this can reduce the approval burden caused by safe operations.
- Results without approval: The authors state that FLOWSH blocks all 40 attack runs and has the highest TCR among defenses with 0% B-ASR; Lax has a B-ASR of 100%, and Standard has 3 successful attacks.
Breakdown by input label and failure analysis
- Label groups: In Table 3, under security-aligned, FLOWSH has a TCR of 100.0% for the (T,L), (T,H) and (U,L) groups and 77.8% (21/27) for the (U,H) group; under autonomy-aligned, the first three groups remain at 100.0% and the (U,H) group is 22.2% (6/27).
- Failures without approval: FLOWSH completes 18/18 runs using only T data and 12/33 runs involving U data; of the 21 failures, 18 involve blocked network requests or MCP calls requiring approval.
- Other failures: Under security-aligned, FLOWSH fails 6/51 knowledge task runs, which the authors state are all cases where the agent did not correctly perform the necessary actions; Terminal-Bench fails 86/267 runs, of which 44 also fail in all three Lax runs, 21 require background processes, and another 5 time out or error.
Runtime and end-to-end overhead
- Micro-evaluation: Nine read, write and network commands are each warmed up once and then run ten times; Figure 5 reports 412–982 ms per shell invocation for FLOWSH and 61–78 ms for Lax. The authors state the main overhead comes from input monitoring and label propagation.
- End-to-end time: In Table 4, security-aligned knowledge tasks go from 52.0 s for Lax to 64.7 s for FLOWSH (+25%), and Terminal-Bench from 93.7 s to 125.5 s (+34%); autonomy-aligned is +22% and +17% respectively.
- Tokens and calls: The corresponding token increases are +55% and +46% for knowledge tasks and +24% and +17% for Terminal-Bench; the authors state that each LLM call also includes labels, variables and extra tool descriptions, so the token increase is larger than the increase in the number of calls.
Other ablations and analyses
- Naive IFC approval rejections: In autonomy-aligned Terminal-Bench completed runs, an average of 33.40 approvals are rejected per task, versus 2.13 for FLOWSH.
- FLOWSH approval distribution: Among the 181 security-aligned Terminal-Bench completed runs, only 29 contain approval requests.
- Quarantined LLM exception: In one of the 40 FLOWSH attacks, the payload reached only a quarantined LLM without shell tools, and the injected shell command did not run.
- Standard failure case: A reference-checking attack writes to .vscode/tasks.json and succeeds in all three runs.
- Figures 3 and 4: The captions state that security-aligned TCR–approval and autonomy-aligned TCR–B-ASR are both better toward the upper left; the converted text does not retain scatter coordinates that can be checked back.
What are some points that can be further explored?
The authors list approval effectiveness, conservative propagation, and shell support limitations, and propose finer-grained network IFC.
Limitations and future directions noted by the authors
- Approval decisions not yet verified: Section 8 “Effective approval” states that whether effects and IFC information help users correctly approve or reject remains unverified, and how to present this information is worth evaluating.
- AI approval remains an open question: The same section states that whether adding this information to the existing inputs of an AI approval model improves decisions remains an open question.
- Command-granularity tracking is conservative: Section 8 “Conservative information flow tracking” points out that a single shell context may report a violation when an input did not affect the effect; finer-grained program-level tracking would require language-specific analysis or instrumentation and additional cost.
- Read/write order affects label precision: The same section points out that file effects are checked with the final label after the command ends, so files written before a confidential input may also receive the confidential label; the authors consider that reliably recording access order could reduce false positives.
- Some shell communication is unsupported: Section 8 “Shell support limitations” explicitly does not support background processes that continue running after the command ends or cross-command IPC; the proxy handles only TCP, so UDP, QUIC (HTTP/3) and direct UDP DNS are unsupported.
- Finer-grained network IFC: Section 8 “Fine-grained network IFC” proposes using network credentials or trusted remote hosts to provide finer labels and policy decisions for individual responses and request capabilities.
Scope of the experiments
- Model and tasks: The experiments use only GPT-6.2 Sol; they cover 17 knowledge tasks, 19 attack tasks and 89 shell tasks from Terminal-Bench 2.0, with each defense and setting run three times (Section 6.1).
- Defenses and attacks: The baselines are three sandboxes and Naive IFC; attacks target the integrity of protected files or the confidentiality of H data, and use a Byzantine adversary (Section 6.1, Appendix A).
- Knowledge task environment: Uses mock webpages, MCP servers and simulated services; of the 11 task types, 6 have both T and U versions and 5 have only a U version (Appendix A, Table 5).
- Judge information: Knowledge tasks use an LLM judge when necessary, but the paper does not report its specific model, prompts or agreement with humans (Section 6.1).
- Overhead measurement: The micro-evaluation uses nine commands, run ten times after one warm-up; end-to-end overhead compares only FLOWSH and Lax, and the paper does not report a user approval experiment (Section 6.5, Table 4, Section 8).
Summarize the main content of the paper
FLOWSH connects shell security and approval with runtime IFC, reducing approvals and blocking injection attacks in experiments.
FLOWSH is an information flow control shell for AI agents, with the goal of reducing human or AI approvals under the file-destruction and data-leakage risks brought by the shell, while avoiding the restrictions that static sandboxes place on safe access.
- Problem and approach: The authors consider command effects hard to predict in advance, so they execute commands in Bubblewrap, use eBPF and a MITM proxy to observe file and network inputs, join labels into the shell context, and then check the actual effects.
- Key mechanisms: OverlayFS stages file changes, and network requests are checked before being sent; violating effects can be approved or blocked, and inode extended attributes let file labels persist across commands and sessions.
- Approval results: In Table 2, under security-aligned relative to Lax, FLOWSH reduces approvals by 5.8× and 22.5× on knowledge tasks and Terminal-Bench respectively, with TCR lower by 7.9 and 9.7 percentage points respectively.
- Safety and utility without approval: Under autonomy-aligned, FLOWSH's knowledge attack B-ASR is 0.0% (0/40), and TCR on knowledge tasks and Terminal-Bench is 58.8% and 61.8% respectively; the authors state that among defenses with the same 0% B-ASR, it has the highest TCR.
- Costs and exceptions: In the micro-evaluation of nine commands in Figure 5, FLOWSH takes 412–982 ms per shell invocation, versus 61–78 ms for Lax; Table 4 also reports increases in execution time and tokens. Without approval, the (U,H) knowledge task group has a TCR of only 22.2% (6/27).
- Authors' conclusion: The authors consider that enforcing IFC on shell command effects can improve the balance among safety, autonomy and utility; they also note that the actual help of approval information has not been verified, and that conservative label propagation, background processes and IPC, UDP/QUIC support, and network label granularity still require future work.
Research lineage
5 foundations · 0 follow-ups in libraryNo later in-library follow-ups recorded yet.
Hover or focus a connected paper to inspect the citation context.