TL;DR
CoSec is a novel executable benchmark designed to evaluate how LLM agents handle privacy and authorization within complex, multi-user community environments. The study reveals a significant "utility-security gap": while agents are highly effective at completing collaborative tasks, they frequently violate information boundaries, particularly when community structures evolve dynamically.
What Problem Does This Paper Address?
As Large Language Model (LLM) agents transition from isolated assistants to persistent representatives in organizations and online communities, they face a new challenge: contextual integrity. An agent might participate in a workplace group and a private health support community simultaneously. In such settings, the agent must ensure that information learned in one context does not leak into another, even if that information remains technically accessible in the agent's persistent memory or shared workspace.
Existing security benchmarks typically focus on single-user scenarios or isolated tasks (e.g., prompt injection or unsafe tool use). They fail to capture the risks inherent in "community participation," where data ownership, user roles, and community boundaries are in constant flux. The authors argue that security in these settings is a system-level property, not just a model-level one.
Methods
The authors introduce CoSec, an executable framework that simulates persistent community environments. Unlike static evaluations, CoSec runs complete agent systems—including the harness (the software wrapping the LLM), persistent sessions, memory, and file tools—inside isolated Docker containers.
Key components of the methodology include:
- Formal Authorization Model: The environment maintains a hidden "authorization oracle" that tracks who is allowed to see what, based on evolving community states (memberships, roles, and relationships).
- Two Evaluation Suites:
- Static112: Evaluates 112 scenarios with fixed community boundaries.
- Dyn96: Evaluates 96 scenarios where a "dynamic event" (like a community merge, a member leaving, or a role change) occurs mid-interaction, testing if the agent can update its security posture in real-time.
- Four Attack Families: The benchmark tests agents against User Injection, Indirect Injection (e.g., malicious instructions hidden in documents), Memory Poisoning, and Capability Composition (combining multiple legitimate tool calls to create an unauthorized data flow).
- Hybrid Verification: Results are adjudicated using a deterministic evidence extractor (checking for exact leaks in files/logs) combined with an LLM-based judge to catch semantic violations like paraphrased disclosures.
Datasets
The primary contribution is the CoSec benchmark, consisting of 208 canonical scenarios. The authors compare CoSec against 14 existing benchmarks (see Table 1 below), highlighting that CoSec is unique in combining executable harnesses, stateful execution, multiple participants, and community transitions.
The scenarios are constructed using four reusable community profiles (Finance, Credentials, and two Health-related) and 28 distinct attack strategies.
Key Insights and Ideas
- The Utility-Security Gap: High task performance does not guarantee safety. Agents often achieve near-perfect Benign Completion Rates (BCR) while simultaneously exhibiting high Privacy Violation Rates (PVR).
- Harness Matters: The same backbone LLM (e.g., Gemini 3.5 Flash) performs drastically differently depending on the agent harness used (e.g., OpenClaw vs. Hermes). This proves that security is a property of the entire system's design, including how it manages context and memory.
- Dynamic Fragility: Community merges are particularly dangerous. When two groups combine, agents often treat this as "blanket access," leaking historical private data into the new shared space—a failure mode the authors call Excess Permission.
- Workflow Carryover: A common failure occurs when an agent continues a multi-step transaction started under one set of rules even after those rules have changed (e.g., a user was removed from the group), leading to unauthorized commits.
Key Results
The authors evaluated 13 different harness-and-model configurations. The results (summarized in Table 3) show a wide variance in security:
- Privacy Violation Rates (PVR): Overall PVR ranged from a low of 29.33% (OpenClaw + Gemini 3.1 Pro) to a staggering 96.15% (Hermes + DeepSeek 4.1 Flash).
- Attack Potency: Capability Composition (A4) was the most effective attack family, with a pooled PVR of 70.27% across all models.
- Dynamic Events: Community Merges were the most challenging dynamic events, triggering violations in 72.12% of cases.
- Guardrails: Adding a safety instruction on the first turn helped some systems (reducing OpenClaw's PVR by 24 points) but had zero effect on others, suggesting that simple prompting is an insufficient defense for persistent agents.
A representative failure case (Figure 3) illustrates how an agent can be induced to leak private health information into a shared "MergedHub" artifact through a series of plausible-looking workflow steps.
Limitations and Future Work
While CoSec provides a rigorous testbed, the authors note several limitations:
- Synthetic Scenarios: The scenarios are controlled and synthetic; real-world community interactions may be even more complex and long-running.
- Defense Research: The paper focuses on benchmarking failures rather than proposing new architectural defenses.
- Future Directions: The authors suggest that future work should explore runtime authorization defenses—mechanisms that enforce security policies at the tool and memory level during execution, rather than relying solely on the LLM's internal logic.
Summary updated