Showing posts with label ACI Automation. Show all posts
Showing posts with label ACI Automation. Show all posts

Sunday, 9 August 2026

The Agent Loop in Cisco ACI: How AI Agents Can Troubleshoot, Automate and Safely Operate Networks

 Artificial intelligence is changing the way network engineers approach monitoring, troubleshooting, and automation.

Traditionally, a network engineer might receive an alert, log in to Cisco APIC, check faults, inspect endpoint information, verify contracts or routing, perform troubleshooting commands, and then decide what action should be taken.

Now imagine an AI agent that can perform many of these activities automatically.

Instead of simply answering:

"What is wrong with my ACI fabric?"

an AI agent could investigate the problem, collect information, analyze the results, decide what to do next, and continue until the problem is resolved—or until it determines that a human engineer needs to take over.

This is where the concept of an Agent Loop becomes important.

The basic idea is simple:

Observe → Think → Act → Evaluate → Continue or Stop

For network engineers, this concept is particularly interesting because Cisco ACI already provides APIs, telemetry, faults, endpoint information, fabric health data, and policy objects that an AI agent could potentially use as tools.

Let's understand the concept using a Cisco ACI troubleshooting example.


1. What Is an Agent Loop?

An Agent Loop is the repeated process through which an AI agent works toward a specific goal.

A simplified version looks like this:

Goal

Understand the situation

Take an action

Observe the result

Reflect on the result

Decide whether to continue

Repeat or terminate

This is different from a traditional chatbot.

A chatbot generally provides an answer based on the information available to it.

An agent is designed to work toward an objective by taking multiple steps.

Simple networking example

Suppose an application team reports:

"The application server cannot communicate with the database server."

A traditional troubleshooting process might involve a network engineer checking:

  • Endpoint learning
  • Bridge Domain
  • EPG membership
  • Contracts
  • Routing
  • L3Out
  • Firewall path
  • APIC faults
  • Interface status

An AI agent could potentially perform these checks sequentially.

For example:

Agent: Check whether the source endpoint is learned.

Result: Endpoint found.

Agent: Check destination endpoint.

Result: Destination endpoint found.

Agent: Check contract between the EPGs.

Result: No applicable contract.

Agent: This could explain the connectivity problem.

Decision: Recommend or request approval for a contract change.

This repeated process is the essence of an agent loop.


2. The Basic ReAct Model

A commonly used way of thinking about agent behavior is:

Think → Act → Observe

The agent first determines what it needs to do, performs an action using an available tool, and then observes the result.

For example:

Think

"I need to determine whether the destination endpoint is actually present in the ACI fabric."

Act

Query APIC for the endpoint information.

Observe

"The endpoint is not currently learned."

The agent now has new information.

It can decide what to investigate next.

For example:

"If the endpoint isn't learned, I should check the connected leaf interface and endpoint attachment information."

This is much closer to how an experienced network engineer troubleshoots a problem.


3. The Complete Agent Loop Adds Reflection

The basic Think → Act → Observe process is not enough for a reliable autonomous system.

After performing an action, the agent needs to evaluate the result.

This is the Reflection step.

The agent essentially asks:

  • Did my action succeed?
  • Did I get useful information?
  • Am I closer to the objective?
  • Should I investigate another area?
  • Should I stop?

The source material identifies reflection and termination as important additions to the basic agent loop.

For network automation, this is extremely useful.

Imagine an AI agent checking why a Cisco ACI endpoint cannot communicate.

It might perform:

Step 1: Check endpoint learning.

Result: Endpoint learned.

Reflection: Endpoint learning is not the problem.

Step 2: Check EPG membership.

Result: Correct EPG.

Reflection: EPG assignment appears correct.

Step 3: Check contract.

Result: Required contract is missing.

Reflection: This is a possible policy issue.

Now the agent has narrowed down the problem.

This is much more useful than blindly running a fixed list of commands.


4. Agent Loop Example: Troubleshooting Cisco ACI

Let's make this more realistic.

Imagine the following environment:

Web EPG → Application EPG → Database EPG

Users report that the application cannot reach the database.

An AI network agent receives the objective:

"Investigate database connectivity failure."

The agent could follow a process such as:

Step 1 – Check Fabric Health

The agent checks whether the ACI fabric has major faults.

Result: Fabric health is normal.

The agent continues.

Step 2 – Check Source Endpoint

The agent checks whether the application server is learned.

Result: Endpoint is learned on Leaf-101.

Continue.

Step 3 – Check Destination Endpoint

The agent checks whether the database endpoint is learned.

Result: Database endpoint is learned on Leaf-102.

Continue.

Step 4 – Check EPG Membership

The agent verifies that both endpoints belong to the expected EPGs.

Result: Correct.

Continue.

Step 5 – Check Contract

The agent checks whether the required communication is permitted.

Result: Required contract is missing.

The agent now has a strong candidate explanation.

But should it automatically create or modify the contract?

Not necessarily.

This is where another important concept appears.


5. Human-in-the-Loop: The Network Engineer Still Matters

One of the most important concepts in autonomous network operations is Human-in-the-Loop (HITL).

The idea is straightforward:

The AI can investigate, but a human may need to approve important actions.

This is especially important in production networks.

The source material describes HITL as an escape mechanism when an agent is uncertain or when an action has significant consequences.

Consider our ACI example.

The agent concludes:

"The application-to-database communication appears to be blocked because the required contract is missing."

It could then propose:

Recommended action: Create or modify the required contract.

Instead of immediately changing production policy, the agent pauses.

HITL checkpoint

AI Agent:

"I identified a possible policy issue. A contract allowing the required application-to-database communication is missing.

Do you want me to proceed?"

The engineer can:

Approve → Agent performs the approved action.

Reject → Agent stops.

Modify → Engineer changes the proposed action.

This approach combines automation with engineering judgment.


6. Why HITL Is Important in Cisco ACI

ACI is policy-driven.

A single policy change can potentially affect many endpoints or applications.

Therefore, an autonomous agent should be particularly careful before performing actions such as:

  • Modifying contracts
  • Changing EPG configuration
  • Changing Bridge Domain settings
  • Modifying L3Out configuration
  • Changing routing policy
  • Moving endpoints
  • Changing interface policies
  • Applying production configuration

The source material specifically identifies production configuration changes, sensitive operations, uncertainty, and organizational approval policies as situations where human involvement may be required.

A useful design principle is:

Let the AI investigate aggressively, but execute production changes cautiously.


7. Termination Conditions: When Should the Agent Stop?

An agent loop needs a clear stopping point.

Otherwise, the agent could continue running unnecessarily.

For example:

Check APIC → timeout

Retry APIC → timeout

Retry APIC → timeout

Retry APIC → timeout

And the process could continue indefinitely.

The source material identifies several common termination triggers, including task completion, maximum iterations, confidence thresholds, human handoff, and error conditions.

For network automation, these can be translated into practical conditions.


8. Termination Condition #1 – Problem Solved

The simplest condition is:

Task completed.

For example:

The agent was asked to determine why an endpoint cannot communicate.

After investigation:

  • Endpoint is learned
  • EPG membership is correct
  • Contract exists
  • Routing is correct
  • Required policy is present

The agent has completed its investigation.

It can provide the final result.


9. Termination Condition #2 – Maximum Number of Attempts

Every autonomous agent should have a maximum iteration limit.

For example:

Maximum troubleshooting steps = 10

If the agent reaches step 10 without finding a reliable explanation, it stops.

This prevents an uncontrolled troubleshooting loop.

The source material describes maximum iterations as a safety mechanism that prevents an agent from running forever.

For example:

Attempt 1: Check endpoint

Attempt 2: Check EPG

Attempt 3: Check contract

...

Attempt 10: No conclusive result

Agent: "I could not determine the root cause within the configured troubleshooting limit. Human investigation is required."

That is much safer than allowing the agent to continue indefinitely.


10. Termination Condition #3 – Error State

Sometimes the problem isn't the network.

The tool itself may be unavailable.

For example:

Agent → APIC API

Result → Authentication failure

The agent should not continuously retry without limits.

Another example:

Agent → APIC

Result → API unavailable

The agent should recognize the error state and stop or switch to an approved fallback.

The source material describes error states as situations where required systems or dependencies fail and the agent should stop trying and report the problem.


11. Termination Condition #4 – Human Approval Required

Sometimes the agent reaches a point where it knows what should happen but does not have authority to perform it.

For example:

Agent diagnosis:

"Traffic is being denied because the required contract is missing."

Proposed action:

"Create contract allowing TCP/443 between the application and database EPGs."

At this point, the agent can request approval.

If the engineer approves:

Continue → Execute approved action

If the engineer rejects:

Stop → Report

This creates a controlled automation boundary.


12. What Happens When an Agent Gets Stuck?

Autonomous systems don't always fail in obvious ways.

Sometimes an agent continues working but isn't actually making progress.

These are called stuck states.

The source material highlights four important examples:

  1. Loop
  2. Oscillation
  3. Dead end
  4. Hallucination

Let's translate these into networking terms.


13. Stuck State #1 – Loop

A loop occurs when the agent repeatedly performs the same action without progress.

For example:

Check APIC endpoint → timeout

Check APIC endpoint → timeout

Check APIC endpoint → timeout

Check APIC endpoint → timeout

Nothing changes.

A good agent should recognize the repeated pattern.

It should either:

  • Try an approved alternative
  • Wait and retry within limits
  • Escalate
  • Stop

It should not continue forever.


14. Stuck State #2 – Oscillation

Oscillation is slightly different.

The agent changes between two approaches but doesn't make meaningful progress.

For example:

Check endpoint → no result

Check contract → no result

Check endpoint → no result

Check contract → no result

Check endpoint → no result

The agent is changing tactics, but it is effectively going around in circles.

Action-history tracking can help detect this behavior.


15. Stuck State #3 – Dead End

A dead end occurs when all available options fail.

For example:

  • APIC API unavailable
  • CLI access unavailable
  • Telemetry unavailable
  • Required monitoring system unavailable

The agent has no useful path forward.

A well-designed system should recognize this situation and escalate rather than inventing an answer.


16. Stuck State #4 – Hallucination

Hallucination is particularly important when AI interacts with network automation tools.

An agent may attempt to call a tool that does not exist or provide an invalid input.

For example, imagine the agent assumes an API endpoint exists when it doesn't.

Instead of recognizing the limitation, it repeatedly tries variations of the same invalid request.

That is dangerous in automation.

The source material describes hallucination as an agent attempting to use nonexistent tools or invalid inputs.

This is why tool validation and strict API permissions are important.


17. How Can We Prevent Agents From Getting Stuck?

A reliable network automation agent should have multiple protection mechanisms.

The source material recommends a layered approach involving iteration limits, action-history tracking, fallback strategies, and human escalation.

For Cisco ACI automation, we can think about it like this:

1. Set an iteration limit

Don't allow unlimited troubleshooting steps.

2. Maintain action history

Record what the agent already checked.

3. Detect repeated actions

If the same API call or troubleshooting operation repeatedly produces the same result, flag it.

4. Define fallback paths

If the preferred data source is unavailable, use an approved alternative.

5. Escalate to a network engineer

When automation reaches its boundary, stop and request human assistance.

This is essentially applying good network engineering practices to AI systems.


18. Example: AI Agent Troubleshooting an ACI Endpoint

Let's put everything together.

User Request

"Investigate why Server-A cannot communicate with Server-B."

Agent Loop

Goal: Determine the connectivity issue.

Check Server-A endpoint

Result: Learned.

Reflect

Server-A is present in the fabric.

Check Server-B endpoint

Result: Learned.

Reflect

Both endpoints are present.

Check EPG membership

Result: Correct.

Check contract

Result: Required communication is not permitted.

Reflect

Potential policy issue identified.

Propose action

"Create or modify the required contract."

HITL checkpoint

Engineer approval required.

Engineer approves

Agent performs approved change

Verify connectivity

Result: Connectivity restored.

Termination

Task completed.

This is a simple example of how an AI agent could combine investigation, reasoning, automation, verification, and human oversight.


19. The Difference Between Automation and Agentic Automation

This distinction is important for network engineers.

Traditional automation

You define exactly what should happen.

For example:

If interface goes down → send alert.

Or:

Run this Python script → configure these interfaces.

The workflow is largely predetermined.

Agentic automation

The system receives a goal and determines the next appropriate step based on observations.

For example:

Goal: Investigate connectivity failure.

The agent might determine:

  1. Check endpoint.
  2. Check EPG.
  3. Check contract.
  4. Check routing.
  5. Check external connectivity.
  6. Form a hypothesis.
  7. Verify the hypothesis.
  8. Request approval if configuration changes are required.

This is why agentic AI is particularly interesting for network operations.


20. Where Cisco ACI Fits Into Agentic AI

Cisco ACI provides a policy-driven environment with centralized management through APIC.

That makes it an interesting platform for experimenting with AI-assisted network operations.

An AI agent could potentially use approved interfaces to:

Read

  • Fabric health
  • Faults
  • Endpoint information
  • EPG information
  • Bridge Domain information
  • Contracts
  • Routing information
  • Interface status
  • Operational statistics

Analyze

  • Identify patterns
  • Correlate multiple faults
  • Compare expected and actual behavior
  • Generate troubleshooting hypotheses

Recommend

  • Possible root cause
  • Next troubleshooting step
  • Configuration change
  • Verification procedure

Execute

Only where the required authorization and safeguards exist.

This last point is critical.

Read-only automation is significantly different from autonomous production configuration.


21. A Practical AI + ACI Architecture

A conceptual architecture could look like this:

Network Engineer

AI Agent

Reasoning / Decision Engine

Policy & Safety Layer

ACI API / Approved Tools

Cisco APIC

ACI Fabric

Telemetry / Faults / Operational Data

AI Agent

The agent receives information from the environment, analyzes it, decides what should happen next, and continues the loop.

For production environments, the Policy & Safety Layer should sit between the agent and configuration-changing operations.


22. Read-Only vs Change-Enabled AI Agents

A useful maturity model for network teams is to start small.

Level 1 – AI Assistant

The engineer asks questions.

Example:

"Why might an ACI endpoint not be learned?"

The AI provides possible causes.

Level 2 – Read-Only Agent

The AI can retrieve information from approved systems.

Example:

"Investigate Server-A connectivity."

The agent collects APIC information but does not modify anything.

Level 3 – Recommendation Agent

The agent investigates and proposes remediation.

Example:

"The contract appears to be missing. I recommend validating the required filter and contract."

Level 4 – Human-Approved Automation

The agent proposes a change and waits for approval.

Approve → Execute

Reject → Stop

Level 5 – Controlled Autonomous Operations

Certain low-risk actions can be performed automatically under predefined policies.

This should only be considered after extensive testing, logging, validation, and governance.


23. Safety: Never Trust an AI Agent Blindly

One of the most important lessons from agentic AI is that confidence does not automatically equal correctness.

An AI agent can produce an incorrect conclusion with a high level of confidence.

The source material specifically highlights overconfidence, silent failures, context loss, and automation bias as important safety concerns.

For network engineers, this means:

AI recommendation ≠ network truth

Always validate critical conclusions.

For production changes, consider:

  • Change approval
  • RBAC
  • Audit logging
  • Rollback capability
  • Maximum iterations
  • Tool restrictions
  • Human approval
  • Post-change verification

24. Logging Is Extremely Important

Every agent action should ideally be traceable.

For example:

09:10:01 – Task received

09:10:03 – Queried endpoint

09:10:04 – Endpoint found

09:10:06 – Checked EPG

09:10:07 – EPG valid

09:10:09 – Checked contract

09:10:10 – Contract missing

09:10:15 – Proposed remediation

09:10:30 – Human approval received

09:10:35 – Change executed

09:10:40 – Connectivity verified

This creates an audit trail.

If something goes wrong, the network engineer can understand what the agent attempted and why.


25. ACI Engineers Should Think in Terms of Guardrails

When building AI-based network automation, don't start with:

"How much can the AI automate?"

Start with:

"What should the AI never be allowed to do?"

For example, an organization might define:

Automatically allowed

  • Read APIC faults
  • Read endpoint information
  • Read interface status
  • Generate troubleshooting reports
  • Recommend configuration changes

Human approval required

  • Contract changes
  • EPG changes
  • Routing changes
  • L3Out modifications
  • Production interface changes

Never allowed without additional controls

  • Broad production configuration changes
  • Changes outside an approved change window
  • Actions affecting critical applications

This approach makes AI adoption much more controlled.


26. A Simple Mental Model for Network Engineers

If you are new to agentic AI, remember this:

Traditional script

Do A → Do B → Do C → Finish

Automation workflow

If A → Do B → If C → Do D

AI Agent

Goal → Investigate → Act → Observe → Reflect → Decide → Repeat → Stop

Safe AI Agent

Goal → Investigate → Act → Observe → Reflect → Safety Check → Human Approval if Required → Verify → Stop

That last model is particularly relevant to production network operations.


27. Key Takeaways

The Agent Loop provides a useful way to understand how AI can move from simple question answering toward autonomous problem solving.

For Cisco ACI engineers, the most important concepts are:

1. Think → Act → Observe

The agent performs actions and learns from the results.

2. Reflection

After every important action, the agent evaluates whether it made progress.

3. Termination

Every agent needs clear conditions for stopping.

4. Stuck-state detection

The system should detect loops, oscillation, dead ends, and invalid tool usage.

5. Human-in-the-Loop

Critical production changes should have an appropriate human approval mechanism.

6. Guardrails

Limit what the agent can access and what it can change.

7. Logging

Record actions, results, decisions, and termination reasons.

8. Verification

After an automated change, verify that the expected outcome actually occurred.


28. Final Thoughts

Cisco ACI changed the traditional networking mindset from configuring individual devices toward defining application and network policy.

Agentic AI could take this concept one step further.

Instead of asking a network engineer to manually investigate every alert, an AI agent could potentially collect information, correlate events, investigate the problem, propose a solution, and—in carefully controlled situations—execute an approved action.

But the objective should not be to remove the network engineer from the process.

The better objective is to make the network engineer more productive.

Think of the AI agent as a junior engineer that can work continuously, collect information quickly, perform repetitive investigations, and prepare recommendations.

The experienced network engineer remains responsible for judgment, architecture, risk, and production decisions.

The future of network operations may therefore not be:

Human OR AI

but rather:

Human + AI + Automation + Guardrails

And Cisco ACI provides an excellent environment for network engineers to start exploring this new model of intelligent network operations.


Related Cisco ACI Articles

If you are learning Cisco ACI, you may also find these articles useful:

Cisco ACI Explained: Concepts, Learning Prerequisites, Benefits, and Limitations
Read the Cisco ACI fundamentals guide

Cisco ACI vPC Explained: Architecture, Working, Configuration, Traffic Flow & Interview Questions
Read the Cisco ACI vPC guide

Why Service Graphs Matter in Cisco ACI — Complete Guide with Configuration Examples
Read the Cisco ACI Service Graph guide

L3Out Subnet Scope Options in Cisco ACI
Read the Cisco ACI L3Out guide

Understanding Domain Types in Cisco ACI
Read the Cisco ACI Domain Types guide

Understanding VLAN Pool Roles in Cisco ACI
Read the Cisco ACI VLAN Pool guide

Cisco ACI Leaf Node ID Swap on vPC Pairs
Read the Cisco ACI Leaf Node ID Swap guide