agent architecture audit

Security Community

Skill notes

When to Activate

MANDATORY for: Releasing any agent or LLM-powered application to production Shipping features with tool calling, memory, or multi-step workflows Agent behavior degrades after adding wrapper layers User reports "the agent is getting worse" or "tools are flaky"

The 12-Layer Stack

Every agent system has these layers. Any of them can corrupt the answer: · Layer · What Goes Wrong 1 · System prompt · Conflicting instructions, instruction bloat 2 · Session history · Stale context injection from previous turns 3 · Long-term memory · Pollution across sessions, old topics in new conversations

1. Wrapper Regression

The base model produces correct answers, but the wrapper layers make it worse. Symptoms: Model works fine in playground or direct API call, breaks in your agent Added a new prompt layer, existing behavior degraded Agent sounds confident but is confidently wrong

2. Memory Contamination

Old topics leak into new conversations through history, memory retrieval, or distillation. Symptoms: Agent brings up unrelated past topics User corrections don't stick (old memory overwrites new) Same-session artifacts re-enter as pseudo-facts

3. Tool Discipline Failure

Tools are declared in the prompt but not enforced in code. The model skips them or hallucinates execution. Symptoms: "Must use tool X" in prompt, but model answers without calling it Tool results look correct but were never actually executed Different tools fight over the same responsibility

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Security
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@affaan-m · no license declared
Token usage
Moderate
Setup complexity
Guided setup
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
Network behavior
External requests
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

01
Phase 1: Scope

Define what you're auditing: Target system — what agent application? Entrypoints — how do users interact with it? Model stack — which LLM(s) and providers? Symptoms — what does the user report?

02
Phase 2: Evidence Collection

Gather evidence from the codebase: Source code — agent loop, tool router, memory admission, prompt assembly Logs — historical session traces, tool call records Config — prompt templates, tool schemas, provider settings Memory files — SOPs, knowledge bases, session archives

03
Phase 3: Failure Mapping

For each finding, document: Symptom — what the user sees Mechanism — how the wrapper causes it Source layer — which of the 12 layers Root cause — the deepest cause

04
Phase 4: Fix Strategy

Default fix order (code-first, not prompt-first): Code-gate tool requirements — enforce in code, not just prompt text Remove or narrow hidden repair agents — make fallback explicit with contracts Reduce context duplication — same info through prompt + history + memory + distillation Tighten memory admission — user corrections > agent assertions

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.