📚 Series ShipPaulJobs AI Learning Roadmap | PART 4 Lesson 2 of 5 · Course Index →

Inside an AI Agent

The seven parts of an AI agent — model, context, memory, tools, planning, execution and evaluation — how they fit together, and the attack surface each one adds.

Captain Paul
Captain Paul
Maritime Cybersecurity · IACS UR E26/E27
November 2026
Line icons of an agent loop, connected agent nodes and a memory store on a navy-to-teal gradient — PART 4 Agentic AI
🎯 Lesson Objective

After this lesson you can name the seven components of an AI agent and what each does; use CoALA's distinction between internal (memory) actions and grounding (external) actions; map each component to its typical security weakness and OWASP category; and describe how an agent should be given an identity, an owner and an inventory entry in a shipping company.

Lesson 15 showed the agent loop from the outside. This lesson opens the box.

We take the agent apart into seven components, using a research framework called CoALA, and ask of each one: what does it do, and how can it go wrong?

1. Why This Matters

Lesson 15 described what an agent does. To secure it, we need to know what it is made of — because each part fails in its own way and needs its own control. "The AI did it" is not an answer an incident report can accept; "the tool layer allowed a write the agent should never have had" is.

2. What Is It? — A Plain Definition

In 2023 Sumers, Yao, Narasimhan and Griffiths proposed CoALA (Cognitive Architectures for Language Agents), a framework that describes a language agent through "modular memory components, a structured action space to interact with internal memory and external environments" and "a generalized decision-making process to choose actions". [CoALA] This lesson uses a simpler seven-part view built on the same idea.

A ship analogy: the bridge team. The officer decides (model); the chart table and the conning display show what matters now (context); the logbook and standing orders hold what was learned before (memory); radar, ECDIS and the radio are the instruments (tools); the passage plan sets the route (planning); the helm order carries it out (execution); and every position fix checks the result (evaluation).

3. How Does It Work? — Seven Components

Components of an AI Agent
ModelThe LLM that reasons and chooses actions. In CoALA's terms it is the decision-maker; its trained weights also hold implicit "procedural" knowledge. [CoALA]
ContextEverything in the model's window right now: instructions, the goal, recent tool results. Anthropic calls managing it context engineering — "curating and maintaining the optimal set of tokens" — and warns that recall weakens as context grows (context rot). [Anthropic]
MemoryInformation kept beyond the current window. CoALA distinguishes working memory (active information for the current decision cycle) from long-term episodic, semantic and procedural memory. [CoALA] (Lesson 19 covers this in depth.)
ToolsThe functions the agent can call (Lessons 13–14). CoALA calls actions on the outside world grounding actions. [CoALA]
PlanningChoosing the next action. CoALA describes a planning stage that proposes candidate actions, evaluates them and selects one — or rejects them and proposes again. [CoALA]
ExecutionRunning the chosen action: the application, not the model, makes the API call or writes the file.
EvaluationChecking results against the goal. A common pattern is the evaluator-optimizer: one LLM call generates, another evaluates and gives feedback in a loop. [Anthropic]

CoALA also separates internal actions on memory — retrieval (reading long-term memory into working memory), reasoning (using the LLM to update working memory) and learning (writing to long-term memory) — from grounding actions on the outside world. [CoALA] For security this split is useful: internal actions change what the agent believes; grounding actions change the world.

4. How It Evolved

Early LLM applications were a single prompt and a single answer. ReAct (2022) added a loop of reasoning and actions [ReAct]; frameworks then added memory and tool layers; CoALA (2023–2024) gave researchers a shared vocabulary for the parts. [CoALA]

Engineering guidance moved in the same direction. Anthropic's three principles for agents are simplicity in design, transparency by showing the agent's planning steps, and careful design of the agent-computer interface through thorough tool documentation and testing. [Anthropic] Later guidance added context engineering: compaction, note-taking outside the window and sub-agents with clean context. [Anthropic]

5. Real Security / Engineering Context

Mapping each component to its typical weakness turns a vague "AI risk" into a list an engineer can work through. The OWASP categories in brackets come from the Top 10 for Agentic Applications and the LLM Top 10. [OWASP ASI]

Attack Surface by Component
ModelManipulated by what it reads (ASI01 goal hijack).
ContextPrompt injection carried in tool results; sensitive data pulled into the window.
MemoryPoisoned entries that persist into later sessions (ASI06).
ToolsMisuse of legitimate tools; over-broad tools (ASI02, LLM06).
ExecutionGenerated code or commands run unchecked (ASI05).
IdentityThe agent's own credentials and permissions (ASI03).

OWASP's LLM06 controls apply across the tool layer: minimise extensions and their functions, avoid open-ended tools such as unrestricted shell or URL access, run with the user's own least-privilege access, and enforce authorisation in the downstream system ("complete mediation") rather than relying on the model's judgement. [OWASP LLM06]

6. Current State

Most production agents today are assembled from these parts by the application developer: a hosted model, a tool list, a context-management strategy and, increasingly, a memory store. Vendors ship building blocks — for example Anthropic documents a client-side memory tool in which the model only requests file operations and the developer's application carries them out on storage it controls. [Anthropic docs]

That division of labour matters: whatever the model asks for, it is the application around it that executes — and the application is where security controls can actually be enforced.

7. Technical Interpretation

🧭 Author's Technical Interpretation — opinion, not a sourced fact

Give every agent its own identity — a service account with its own credentials, not a person's token and never a shared admin account. Then every action in every downstream log can be traced to that agent.

Assign an owner per component: the model and prompt to the AI team, tools and their permissions to the system owners, memory to the data owner, and evaluation to whoever signs off the agent's output.

If the planning steps are not logged, the agent cannot be investigated. Transparency is not only a design principle; it is the audit trail.

8. Maritime Connection

A ship already works this way: decisions, instruments, records and checks belong to defined people under the Safety Management System. An agent should be described the same way before it is allowed near fleet data.

Agent Components in Maritime Terms
IdentityA named service account per agent, in the same access-review cycle as crew and vendor accounts.
ToolsRead-only fleet data first (performance, PMS, certificates); no write access to on-board systems.
InventoryIACS UR E26 requires the vessel asset inventory to include software components of in-scope systems and the networks connecting them to systems ashore, and treats networks outside its scope as untrusted, requiring in-scope systems to be protected against unauthorised access from them. [IACS UR E26] An agent's tool connectors that reach vessel networks are software components of that kind.

The asset-inventory point is the author's reading of UR E26, which does not mention AI agents.

📎 Related on ShipPaulJobs

Why what goes into the model's window matters as much as the model itself.

9. Security Considerations

Shared or borrowed identity

An agent acting with a person's full token inherits all of that person's rights (OWASP ASI03). Use a dedicated, least-privilege identity. [OWASP ASI]

Untrusted tool results

Treat every tool result as data that may contain instructions; never let it change the agent's goal or permissions.

Generated code

If the agent can write and run code, run it in a sandbox with no network or credentials by default (OWASP ASI05). [OWASP ASI]

Complete mediation

Authorisation must be checked by the target system on every call, not assumed because the agent 'decided' it was fine. [OWASP LLM06]

🔑 Key Takeaways — What We Learned
  • An agent = model + context + memory + tools + planning + execution + evaluation.
  • CoALA separates internal actions (retrieval, reasoning, learning on memory) from grounding actions on the outside world.
  • Anthropic's principles: simplicity, transparency of planning steps, and careful tool (agent-computer interface) design.
  • Each component has its own attack surface — goal hijack, poisoned context or memory, tool misuse, unchecked code, abused identity.
  • Give each agent its own least-privilege identity, an owner per component, and an inventory entry; enforce authorisation in the target system.
⏭ Where This Leads Next

Lesson 17 — Multi-Agent Collaboration puts several agents together: planner, research, analysis, security and reporting agents — what they gain, what they cost and how failures spread between them.

The Cybersecurity side of ShipPaulJobs continues in parallel: see the Maritime Cybersecurity Learning Roadmap.

📚 PART 4 — Agentic AI · Progress
✓ Done · L15: Agentic AI L16: Inside an AI Agent · You are here Coming next · L17: Multi-Agent Collaboration Coming next · L18: Orchestration Coming next · L19: AI Memory
📚 Official Sources & Further Reading

Sources checked November 2026. Vendor statements are the vendor's own claims.

Research papers
  • Sumers, T. R., Yao, S., Narasimhan, K., Griffiths, T. L. "Cognitive Architectures for Language Agents", arXiv:2309.02427 (TMLR version, 2024) — arxiv.org.
  • Yao, S. et al. "ReAct: Synergizing Reasoning and Acting in Language Models", arXiv:2210.03629 (ICLR camera-ready version, 2023) — arxiv.org.
Official sources & frameworks
  • OWASP GenAI Security Project (9 Dec 2025). OWASP Top 10 for Agentic Applications for 2026 — genai.owasp.org.
  • OWASP GenAI Security Project. LLM06:2025 Excessive Agency — genai.owasp.org.
  • IACS UR E26 Rev.1 (Nov 2023), Cyber resilience of ships. Sections 4.1.1 and 4.2.6 — IACS PDF.
Vendor documentation
Captain Paul
✍️ About the Author
Captain Paul

Maritime cybersecurity consultant at ShipPaulJobs, writing on IACS UR E26/E27, maritime IT/OT security and how AI changes security operations at sea and ashore.

LinkedIn →

⚓ Join the ShipPaulJobs Community

Join →
Share

Comments

Top Ranked · Last 30 Days

Popular Posts