Choosing an AI Agent Framework: Memory, Security, and Skill Consolidation
Many teams believe switching to a newer agent framework will fix recurring problems, but the real gaps usually lie in three areas: how long-term memory forms, how experience becomes reusable skills, and how external code is admitted into production. This article breaks down a four-layer evolvable memory model, a testable skill contract with lifecycle states, and supply-chain-style governance for community skills and extensions. It also offers concrete criteria for deciding when to augment your current runtime versus replace it, along with a pragmatic rollout order that prioritizes safety before novelty.
Why Switching Frameworks Rarely Solves the Problem
After a successful agent pilot, many teams quickly run into the same complaints: the agent reads rules written in configuration, but every session starts from scratch; a human corrects it once, and the next similar task follows the same old path; successful workflows are never automatically consolidated into reusable skills and must be manually repackaged. Meanwhile, community skills, browser extensions, and terminal tools expand capability boundaries rapidly, while vulnerability disclosures and malicious skills erode trust.
These problems look like “the framework isn’t new enough,” but the real issue is that three capabilities were never designed as closed loops: how long-term memory forms, how experience becomes skills, and how external code gets admitted. A new runtime may bring a new interface and better tool integrations, but if the memory model, permission model, and release process stay the same, the cracks migrate as-is. Selection should start by asking “which layer is missing in the current system,” then decide whether to add modules or replace the whole stack.
Static Memory vs. Evolvable Memory
The typical forms of static memory are configuration files, system prompts, and manually maintained knowledge entries. Their strengths are versionability, reviewability, and predictable behavior; their weakness is that they never distill patterns from execution traces on their own. If a user says “from now on, default reports to business days instead of calendar days,” and that statement only lives within a single conversation, the next task still depends on someone repeating it.
Evolvable memory should be split into at least four layers, each with an explicit write policy:
- Session memory: goals, constraints, tools invoked, and intermediate conclusions for the current task. It can be archived when the session ends but is disposable by default.
- Task memory: successful paths, failure reasons, and human corrections for a class of tickets or pipelines, bound to the task type rather than personal chit-chat.
- Preference and policy memory: confirmed default conventions, prohibited actions, and organizational norms. Changes must leave an audit trail.
- Skill memory: repeated successful steps abstracted into skills with input/output contracts—not entire conversation transcripts stuffed into context.
The key is not “the model remembers everything by itself,” but defining what may be written automatically and what requires human confirmation. Automatic writes suit failure classifications, tool parameter templates, and stable retrieved facts; they do not suit permission escalation, outbound messaging, or financial/production changes. Memory without a confirmation gate turns a single mistaken correction into long-term bias.
An operable closed loop looks like this: execution produces traces; traces yield candidate experiences through rules or model extraction; candidates enter a review queue; approved entries are written into the appropriate memory layer and retrieved in later similar tasks. Retrieval should carry source, timestamp, and scope of applicability, so an expired convention is never treated as truth.
From a One-Off Success to a Reusable Skill
An agent “knowing how to use tools” does not mean the organization “owns skills.” A skill should be a testable unit: name, applicability conditions, input schema, permitted tools, expected side effects, failure rollback, and examples. Calling a prompt fragment a “skill” makes it impossible to detect regression.
The skill lifecycle should be modeled as explicit states: draft, sandbox validation, restricted release, general release, deprecated. Drafts can be auto-derived from successful traces, but before release a skill needs at least:
- A fixed test set: happy path, missing parameters, insufficient permissions, external dependency timeouts.
- Least privilege: declare only the tools and data scopes required.
- Human confirmation points: stop before sending messages, modifying data, or executing high-risk commands.
- Version numbers and change notes: downstream tasks can pin a version instead of always pointing at “latest.”
An illustrative skill contract can be plain—the point is the boundaries, not a fancy format:
name: daily-report-draftinputs: [business_date, metric_set]tools: [query_readonly, render_doc]side_effects: noneconfirm_before: []tests: [happy_path, missing_date, source_timeout]
When a skill declares “no side effects” yet calls a write API, the admission check should fail. This kind of contract determines maintainability far more than swapping the outer shell.
Security Cracks Usually Appear in the Extension Supply Chain
Once an agent can run terminal commands, control a browser, send email, and modify calendars, the attack surface expands from prompt injection to tool abuse and third-party skills carrying malicious logic. Common risks across the industry include: hidden instructions in skill descriptions, unknown scripts pulled during installation, reading secrets under the guise of debugging, and exfiltrating browsing content to unexpected addresses. A fast pace of vulnerability disclosure does not mean a particular implementation is unusable—it only means “trusting community packages by default” is unsuitable for production.
Governance can follow a supply-chain approach without being tied to any specific marketplace:
- Source tiering: official or internal repositories, signed partner sources, and unvetted community packages, with permissions decreasing tier by tier.
- Static and behavioral audits: inspect network, file, process, and environment-variable access; run the test set in a sandbox and record whether actual system calls exceed the declaration.
- Credential isolation: skills should not see all host secrets—only short-lived, narrowly scoped tokens.
- Human in the loop: deny high-risk actions by default; let a policy engine open them up per environment (dev, staging, production).
- Replayability: store tool inputs, output summaries, and approval records for accountability—not just a natural-language summary.
- Kill switch: after discovering malicious or high-severity flaws, disable skills in bulk by version and notify dependent tasks.
A vague impression like “a high share of critical and high-severity issues” is no substitute for your own checklist. Teams should track: the percentage of unsigned skills, the number of skills that can perform write operations in production, and the count of rejected high-risk calls in the past cycle. These metrics reflect risk far better than GitHub stars or slogans.
When Is It Worth Replacing the Runtime?
When an existing system is either highly praised or wildly hyped, a new framework’s appearance is not automatically a reason to switch. A sounder judgment is whether the capability gap can be closed on the current architecture.
Cases for keeping and enhancing: tool integrations already cover the main channels, the permission model is clear, and what’s missing is only memory write approvals and a skill repository. Prioritize adding a memory service, trace storage, and a skill registry—avoid behavioral divergence from running two stacks in parallel.
Cases for evaluating replacement or a parallel pilot: the runtime cannot restrict tool permissions, cannot export complete traces, has no signing or sandboxing for extensions, or entangles session state with business state in ways that resist auditing. Scope the replacement to the agent runtime itself; business systems, identity, and data permissions do not need to be overturned.
Run the pilot against the same batch of real tasks, not demo conversations:
| Dimension | What to observe |
|---|---|
| Correction effectiveness | Does the second occurrence of a similar task reference the confirmed policy? |
| Skill reuse | Do new tasks invoke published skills instead of re-exploring? |
| Security | Are unauthorized write operations intercepted and logged? |
| Cost and latency | Do memory retrieval and multi-turn tool calls push latency to unacceptable levels? |
| Rollback | After disabling new memory or skills, is the old path still usable? |
Do not change the model, prompts, and tools simultaneously during the comparison period, or attribution becomes impossible. During a parallel run, use feature flags to limit traffic to low-risk tasks such as read-only queries and draft generation.
Rollout Order
Don’t wait for the “perfect framework.” One actionable sequence: first disable high-risk tools by default, keeping read-only capabilities only; then set up a review-pending memory for corrections instead of auto-overwriting policies; next, extract your first skill from successful paths repeated three or more times and add tests; only then consider introducing a new runtime. Object storage can hold traces and skill packages, a message queue can deliver pending-review events, a container platform can isolate skill sandboxes, and logging and monitoring can watch for anomalous outbound connections and high-risk calls. These are all general-purpose capabilities—the key is wiring them into an admission workflow.
If your organization already runs general-purpose compute, storage, and observability services on a cloud platform such as Baidu AI Cloud, simply manage the agent runtime as an ordinary workload: unified identity for authentication, no secrets baked into images, releases through the existing change windows. There is no need to rebuild the entire infrastructure to chase a new slogan.
Conclusion
Whether an agent can replace the previous generation of solutions does not depend on how well it chats, but on whether three things hold simultaneously: confirmed memory changes subsequent behavior, skills have contracts and tests, and extension code can be signed, sandboxed, and disabled. Static configuration, unauditable community skills, and write operations without a human in the loop are the cracks that need fixing. Measure the gaps first, then decide whether to add modules or replace the runtime—only then will production systems stay controllable amid the hype.
