You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security: Agent self-modification patterns in Canvas memory module (ASI10) #7918
The Canvas memory module at autogen_ext/memory/canvas/_canvas.py contains patterns where the agent can modify its own code and state during execution. Self-modification is a critical security boundary violation — it allows an agent to evolve its behavior beyond its original constraints, potentially escaping safeguards or executing arbitrary operations.
An agent with memory modification capability can alter its own operating parameters, tool access patterns, or behavioral constraints. This is particularly dangerous in multi-agent systems where one compromised agent can modify shared memory state affecting all agents.
Severity
HIGH — self-modifying agent code violates security invariants.
Suggested Mitigation
Separate read-only memory from mutable agent state
Audit all self.* modifications within agent execution context
Consider append-only memory patterns for auditability
Add agent integrity checks before and after memory modifications
governance_state_change — Model modification, requires cryptographic verification
This mapping is clean, implementable, and directly actionable. A question for deeper discussion:
Does AutoGen's current memory architecture distinguish between these classes? From what I can see scanning the codebase, the Memory abstraction and ChatCompletionContext don't appear to enforce different write semantics per memory type. Everything looks like a flat key-value store with uniform mutation access — which means any agent with update_context permission can effectively perform a governance_state_change without the verification step.
Two relevant detection approaches from AgentGuard (our ASI scanner):
ASI-AGENT-COLLUSION — Detects patterns where agents manipulate shared state to influence sibling agent behavior across trust boundaries. A governance_state_change without verifiable attestation is exactly the signal this rule looks for at the state-mutation layer.
ASI-MEMORY-POISON — Flags writes to agent memory surfaces that originate from untrusted tool output or inter-agent channels. If Canvas memory can be modified by tool results without integrity checks, this triggers.
Suggested deterministic guard approach: Wrap mutable memory surfaces in a MemoryGuard that enforces:
�ppend_only surfaces: hash-chained, no deletion, write-once
mutable surfaces: per-agent namespace isolation + atomic CAS writes
governance surfaces: require a signed attestation from an authorized transition function before mutation
The key insight is that you don't need probabilistic AI to detect this — you need deterministic state-machine invariants. Agent self-modification is detectable at the permission layer by enforcing differential write authority per memory class.
Would be interested in the team's thoughts on whether a memory-class-aware access control model is on the roadmap.
governance_state_change → denied by default unless an authorized transition record exists externally.
The critical insight from the last exchange is the shared-write-path problem: if tool results and sibling-agent messages can update working memory through the same path as governance state mutations, then an agent can perform a governance_state_change through what appears to be ordinary memory mutation. That's the thing to lock down.
The fix doesn't require probabilistic AI detection — it's a deterministic state-machine invariant at the permission layer. Differential write authority per memory class is the right primitive.
Has the team considered adding memory-class-aware access control to their security roadmap? Even without a full implementation, documenting the three-tier boundary in the security model would help users understand which memory surfaces are safe for untrusted agent output and which require attestation.
I can consistently reproduce the behavior using the same steps described in this issue. I also tested with a clean environment and the problem still occurs.
This doesn't appear to be an isolated setup issue. Please let me know if you need any additional logs or if there's a workaround available.
Activity
dockfixlabs commentedon Jul 6, 2026
Excellent classification model, Massimiliano Brighindi brighissimo@gmail.com (@Tuttotorna). The three-tier typology is precisely the right lens:
This mapping is clean, implementable, and directly actionable. A question for deeper discussion:
Does AutoGen's current memory architecture distinguish between these classes? From what I can see scanning the codebase, the Memory abstraction and ChatCompletionContext don't appear to enforce different write semantics per memory type. Everything looks like a flat key-value store with uniform mutation access — which means any agent with update_context permission can effectively perform a governance_state_change without the verification step.
Two relevant detection approaches from AgentGuard (our ASI scanner):
ASI-AGENT-COLLUSION — Detects patterns where agents manipulate shared state to influence sibling agent behavior across trust boundaries. A governance_state_change without verifiable attestation is exactly the signal this rule looks for at the state-mutation layer.
ASI-MEMORY-POISON — Flags writes to agent memory surfaces that originate from untrusted tool output or inter-agent channels. If Canvas memory can be modified by tool results without integrity checks, this triggers.
Suggested deterministic guard approach: Wrap mutable memory surfaces in a MemoryGuard that enforces:
The key insight is that you don't need probabilistic AI to detect this — you need deterministic state-machine invariants. Agent self-modification is detectable at the permission layer by enforcing differential write authority per memory class.
Would be interested in the team's thoughts on whether a memory-class-aware access control model is on the roadmap.
dockfixlabs commentedon Jul 16, 2026
Following up on this one as well — the three-tier enforcement boundary model articulated by Massimiliano Brighindi brighissimo@gmail.com (@Tuttotorna) is a strong foundation, and it would be worth keeping the discussion moving.
The agreed enforcement boundary:
The critical insight from the last exchange is the shared-write-path problem: if tool results and sibling-agent messages can update working memory through the same path as governance state mutations, then an agent can perform a governance_state_change through what appears to be ordinary memory mutation. That's the thing to lock down.
The fix doesn't require probabilistic AI detection — it's a deterministic state-machine invariant at the permission layer. Differential write authority per memory class is the right primitive.
Has the team considered adding memory-class-aware access control to their security roadmap? Even without a full implementation, documenting the three-tier boundary in the security model would help users understand which memory surfaces are safe for untrusted agent output and which require attestation.
Happy to contribute if there's interest.
bloxfruitvaluez-lgtm commentedon Jul 24, 2026
I'm experiencing the same issue as well.
Environment:
AutoGen version: [your version]
Python: [your version]
OS: [Windows/macOS/Linux]
I can consistently reproduce the behavior using the same steps described in this issue. I also tested with a clean environment and the problem still occurs.
This doesn't appear to be an isolated setup issue. Please let me know if you need any additional logs or if there's a workaround available.
Same Issue is Ocuring with my friend on his Blox Fruit Trading Website.
IgorGanapolsky commentedon Jul 24, 2026
Agentic systems are turning into always-on factories: one request fans out into model calls, tool calls, policy checks, and storage.
The hard part is rarely tokens/sec — it is control-plane reliability:
If you share one sanitized failing run (expected vs actual + tool result), I can map which pillar is broken. Architecture only.