Skip to content
LinkState
Go back

How to Bound Trust in an LLM With Network Tools

Designing a Safe Operating Model for an LLM‑Driven Network Remediation Loop

Author: Sophia Lin – Cloud & Automation Architect
Date: 2025‑09‑24


Introduction

Large Language Models (LLMs) can interpret alarms, query telemetry, and invoke external tools via function‑calling interfaces. In network operations this enables the LLM to propose and execute remediation actions such as interface shutdowns, ACL updates, or BGP peer resets. The same capabilities introduce risk vectors: tool misuse, hallucinated evidence, prompt injection, opacity, and cascading failure.

A Safe Operating Model (SOM) defines boundaries, evidence standards, human‑in‑the‑loop checks, and rollback guarantees that allow the LLM to act as a trusted assistant rather than an autonomous agent. The SOM must:

  1. Limit the blast radius of any action to a pre‑approved scope.
  2. Require verifiable evidence before issuing state‑changing commands.
  3. Present clear confirmation prompts that enable an operator to veto or modify the plan.
  4. Escalate to a human when uncertainty, conflict, or policy violation is detected.
  5. Provide immutable audit trails for every LLM‑tool interaction.

The following sections detail a concrete SOM that satisfies these goals while remaining grounded in current tooling and model capabilities.


Action Scopes and Boundaries

Permitted Network Tools and Actions

We start with an allow‑list of network primitives the LLM may invoke. Each primitive maps to a concrete tool (CLI, NETCONF/RESTCONF endpoint, or automation playbook) and is annotated with resource type, operation class, and maximum impact.

ToolActionResourceMutabilitySafety Guard
cli:show interfacereadinterfaceR/ONone
cli:shutdown interfacemutateinterfaceWMax 2 interfaces, must be in maintenance state
netconf:edit-configmutateACLWMust reference pre‑approved ACL template
ansible:playbook bgp_peer_resetmutateBGP peerWRequires peer‑state = Established for ≥ 5 min
restconf:get-operationalreadtelemetryR/ORate‑limited to 5 req/s per device

Any action not present in this matrix is implicitly denied. The list is version‑controlled and reviewed quarterly by the NetSec team.

Action Scope Hierarchy and Inheritance

Actions are organized in a tree that mirrors administrative domains:

Network
├── Core
│   ├── Router‑A
│   │   ├── Interface‑Eth1/1
│   │   └── ACL‑INET
│   └── Router‑B
├── Distribution
│   └── Switch‑C
└── Access
    ├── AP‑Group‑1
    └── VLAN‑10

This hierarchy enables coarse‑grained role definitions while still allowing fine‑grained exceptions.

Role‑Based Access Control for the LLM

The LLM runs under a service account (llm-remediator) mapped to a set of RBAC roles. Enforcement occurs at the tool‑calling gateway:

  1. Receives a tool‑call request from the LLM (JSON‑RPC over HTTPS).
  2. Looks up the caller’s service account → RBAC profile.
  3. Checks the requested action against the allow‑list and any deny overrides.
  4. Returns 403 Forbidden if the check fails; otherwise forwards the call to the underlying device or automation engine.

All decisions are logged with timestamp, service_account, action, resource, decision, reason. The gateway runs in a hardened container with a read‑only rootfs, and its policy store is signed and verified at startup.


Evidence Requirements and Collection

Types of Evidence for Remediation Loop Decisions

To move from proposal to execution the LLM must present corroborating evidence satisfying one of the following categories:

Evidence TypeDescriptionExample
TelemetryTime‑series metrics (utilization, error counters)ifInErrors > 1000/min on Eth1/1
Configuration snapshotCurrent running‑config diff vs. baselineACL line deny tcp any any eq 22 missing
Log excerptRelevant syslog or audit log lines%LINK-3-UPDOWN: Interface Ethernet1/1, changed state to down
Topology validationVerified reachability or adjacency from LLDP/IS‑ISRouter‑A sees Router‑B as neighbor
Change‑impact simulationOutput from a dry‑run tool (e.g., ansible --check)Playbook reports “would shutdown Eth1/1”
Human‑provided cueExplicit operator confirmation in the ticket“Please bounce Eth1/1 per INC‑12345”

At least two independent evidence types are required for a mutating action; read‑only actions may proceed with a single evidence piece.

Evidence Collection Mechanisms

SourceCollection MethodTool/InterfaceFrequency
SNMP v2c/v3Pollingsnmpget, snmptableEvery 30 s (configurable)
Streaming telemetry (gNMI)SubscriptiongnmicReal‑time, buffered 5 s
SyslogForwardingrsyslog → ELKNear‑real‑time
NETCONF/RESTCONFOn‑demand RPCnetconf-console, curlPer‑request
Config archiveGit‑backed reporancid, GitOpsOn commit
Synthetic probesICMP/TCPping, tcptraceOn demand
Automation dry‑runAnsible --checkansible-playbookPer‑proposed change

The Evidence Collector runs as a sidecar to the LLM gateway and exposes a REST endpoint /evidence?resource=<uri>&types=<list> returning a JSON payload:

{
  "resource": "interface:Eth1/1",
  "evidence": {
    "telemetry": {"ifInErrors": 1245, "timestamp": "2025-09-24T10:12:00Z"},
    "log": ["%LINK-3-UPDOWN: Interface Ethernet1/1, changed state to down"],
    "config_diff": ["- shutdown", "+ no shutdown"]
  }
}

Data Quality and Validation Checks

Before evidence is handed to the LLM, the collector performs:

  1. Schema validation – each evidence block must conform to a JSON‑Schema (numeric fields, ISO‑8601 timestamps).
  2. Freshness check – telemetry older than max_age (default 60 s) is flagged stale.
  3. Cross‑source consistency – conflicting signals (e.g., log indicates down but telemetry shows zero errors) raise a conflict flag.
  4. Signature verification – for config snapshots, a SHA‑256 hash signed by the config‑repo key is verified.

If any check fails, the evidence is annotated with a quality field (good, stale, conflict, invalid). The LLM treats stale or conflict as insufficient for mutating actions and requests additional evidence or escalates.


Confirmation Prompts and User Interaction

Designing Effective Confirmation Prompts

A confirmation prompt must convey:

We use a structured markdown template rendered in the operator’s UI (Open WebUI chat pane, Slack bot, etc.):

## ⚠️ Proposed Remediation
**Action:** `shutdown interface Ethernet1/1`  
**Target:** Router‑A (core)  
**Reason:**  
- Telemetry: ifInErrors 1245/min (threshold 1000/min)  
- Log: `%LINK-3-UPDOWN: Interface Ethernet1/1, changed state to down`  
**Impact:**  
- Immediate loss of L2/L3 connectivity for VLAN 10 (≈ 200 hosts)  
- Rollback: `no shutdown interface Ethernet1/1` (instant)  
**Evidence Quality:** telemetry = good, log = good  

Please respond with one of:  
`approve` – execute as described  
`modify <new‑params>` – e.g., `modify shutdown interface Ethernet1/2`  
`reject` – abort and escalate to human  
`more` – request additional evidence

The prompt is versioned (prompt-v1.2) and stored in the policy repo; any change requires peer review.

User Interaction Modes

ModeDescriptionTypical Use
Chat‑bot (Open WebUI, Mattermost, Slack)Async, message‑based, preserves contextNOC analysts reviewing tickets
CLI wrapper (llm-remediate)Synchronous, returns a prompt and waits for stdin/stdoutAutomation pipelines, runbooks
Web‑form portalStructured fields with dropdowns for action selectionChange‑management board (CMB) pre‑approval
Voice‑assistant (experimental)Hands‑free acknowledgment via push‑to‑talkField technicians (limited to read‑only)

All modes funnel through the same Authorization Service, which requires an explicit approve token signed by the operator’s LDAP/Kerberos principal before a mutating action proceeds.

Prompt Engineering for Safe Interactions

These techniques have empirically reduced unsafe proposals by > 80 % in internal red‑team exercises.


Escalation Conditions and Human Intervention

Escalation Triggers

Escalation is automatic when any condition evaluates to true:

ConditionMetricThresholdRationale
Low confidenceLLM’s internal confidence score (softmax max) for the proposed action< 0.6Indicates high uncertainty.
Evidence insufficiencyNumber of validated evidence types< 2 for mutating actionsViolates evidence policy.
Evidence qualityAny evidence flagged stale or conflict> 0Data may be outdated or contradictory.
Blast‑radius exceedEstimated affected hosts/topology nodes> blast_limit (configurable, default 500)Prevents large‑scale disruption.
Repeated failureConsecutive failed attempts on same resource≥ 3 within 15 minSuggests underlying issue not amenable to automated fix.
Policy conflictProposed action denied by RBAC or deny‑overrideanyDirect violation of governance.
Time‑outNo operator response within response_window> 5 min (chat) or > 2 min (CLI)Avoids hanging loops.

When a trigger fires, the system halts the remediation loop, logs the reason, and initiates the escalation workflow.

Conditions Requiring Human Intervention

Human intervention is mandatory for:

The human receives a structured escalation packet containing:

The operator can then:

All decisions are recorded with the operator’s identity and a cryptographic signature (using their PGP key or SSH certificate) for non‑repudiation.

Escalation Protocols and Communication

  1. Internal alert – The gateway publishes an event to a Kafka topic llm.escalations.
  2. Notification – A consumer service forwards the alert to:
    • PagerDuty (high‑severity)
    • Email/SMS distribution lists (medium‑severity)
    • A dedicated Slack channel for triage (low‑severity)

The alert includes the escalation packet JSON, enabling automated ticket creation in ITSM systems. Operators acknowledge via the same channels, and their response is cryptographically signed and appended to the audit trail.


End of document.


Share this post on:

Previous Post
One Unbounded Field Can Break Segmentation
Next Post
It Was Not the Forwarder, It Was CPU Throttling