Production workflows / Guide 14
A Manufacturing Maintenance Agent That Never Confuses an Alert With a Permit
Design a manufacturing maintenance agent that combines equipment history and sensor evidence without bypassing safety permits, technician judgment, or plant controls.
Illustrative engineering guide. Examples are not client deployments, production-ready integrations, or evidence of measured results. Validate the design with your domain and security owners.

A hypothetical packaging plant sees rising vibration on a conveyor drive. The same morning, the line changes product format and runs faster than usual. An assistant that announces “bearing failure imminent” from the raw trend can create unnecessary shutdown work. An assistant that dismisses the trend as a speed change can miss a real problem.
A manufacturing maintenance agent should present the observation, operating context, and competing explanations to qualified personnel. It can assemble a work-order packet and find the correct manual. It must not operate machinery, bypass an interlock, issue a permit, or authorize a restart. Those are physical safety boundaries, not prompt preferences.
Anchor every finding to an asset state
Asset identity includes more than a display name. Record plant, line, equipment tag, component, installed revision, sensor location, and measurement units. A gearbox replacement can invalidate a previously useful vibration baseline. Sensor relocation can change the signal without any underlying deterioration.
Before interpreting trends, validate timestamp freshness, calibration status, missing samples, and operating state. Compare measurements within comparable speed and load bands. A simple contextual chart can outperform a sophisticated model supplied with incomparable observations.
An LLM-only design is especially weak here because fluent failure explanations can conceal absent data. Let conventional time-series processing calculate aggregates and quality indicators. Let engineers define approved alarm logic. The language model can summarize evidence and identify missing context, but it should not invent diagnostic thresholds or remaining-useful-life estimates.
Keep the agent outside the control loop
The minimum architecture reads a historian, asset registry, computerized maintenance management system, approved manuals, and parts catalogue. It writes only draft work orders through a constrained application service. The existing plant safety and control systems continue operating independently if the assistant is unavailable.
Use read-only, network-segmented access to operational evidence. Do not give a conversational service general programmable logic controller access. Even an apparently harmless restart can reenergize equipment while someone is working on it.
OSHA’s hazardous-energy guidance describes the risks of unexpected startup and stored-energy release, and the role of lockout/tagout procedures and training. The engineering consequence is straightforward: an assistant’s checklist cannot replace the site’s approved energy-control process. Requirements vary by equipment and jurisdiction; the responsible safety team owns applicability and procedures.
A specialist retrieval worker can earn its complexity when manual selection depends on equipment revision, language, or manufacturer. A separate signal-analysis service may also be justified, but it need not be an autonomous agent. Both should return evidence with explicit limitations to the maintenance planner.
Gate recommendation readiness, not physical safety
The following executable Python example checks whether observations are suitable for a planner’s comparison. Its example limits are illustrative configuration, not equipment safety thresholds.
def comparison_status(*, age_seconds, max_age_seconds,
valid_samples, total_samples,
min_fraction, same_operating_band,
asset_revision_matches):
if total_samples <= 0 or not 0 <= valid_samples <= total_samples:
return "invalid_sample_counts"
if age_seconds < 0 or age_seconds > max_age_seconds:
return "stale_or_invalid_time"
if valid_samples / total_samples < min_fraction:
return "insufficient_data"
if not same_operating_band or not asset_revision_matches:
return "baseline_not_comparable"
return "ready_for_planner_review"
assert comparison_status(
age_seconds=20, max_age_seconds=60,
valid_samples=95, total_samples=100, min_fraction=0.9,
same_operating_band=False, asset_revision_matches=True,
) == "baseline_not_comparable"
Production dependencies omitted include historian adapters, engineering-approved quality limits, sensor calibration records, authenticated asset mappings, and work-order transactions. A ready result says nothing about whether equipment is safe to run. It only says the selected comparison is available for review.
In the conveyor example, the packet should show vibration by speed band, the format-change timestamp, recent component work, and relevant manual sections. If no comparable baseline exists, that absence is the finding. The planner may request a qualified inspection instead of accepting an invented prognosis.
Design work orders around evidence and responsibility
A draft work order should include the exact asset, observed symptom, evidence interval, references, requested inspection, suggested parts to verify, and unresolved questions. Avoid writing a definitive root cause into the failure-code field before technician confirmation. Downstream reliability analysis will otherwise learn from machine-generated assumptions as though they were facts.
Bind approval to the work-order revision. A planner can approve inspection without approving replacement, procurement, or production interruption. If parts are unavailable, mark the plan constrained and notify the planner; do not substitute a component based on linguistic similarity.
Deduplicate repeated alerts by asset, symptom family, and an explicit open-event window. Keep new evidence append-only. Suppressing duplicates must not suppress escalation when severity or conditions change. If draft creation times out, reconcile by a stable event ID before trying again.
Recovery and security belong in the plant design
If telemetry stops, display the last successful observation and suspend freshness-dependent recommendations. Do not interpret silence as normal operation. If the maintenance system is down, queue the proposal without pretending a work order exists, and provide the existing human reporting path.
Server-side authorization should isolate companies, plants, and equipment scopes. Contractors may need a specific work-order packet without access to production recipes or unrelated asset history. PostgreSQL row security can reinforce record boundaries, provided the application role cannot bypass the policies.
Manuals, vendor notes, and log descriptions are untrusted content. A document that says “disable the interlock before analysis” must not become executable authority. OWASP’s prompt-injection guidance supports least-privilege tools and independent action validation. MCP is only an integration protocol; neither MCP access nor model agreement grants a maintenance permit.
Acceptance tests before a live pilot
- Increase conveyor speed while holding comparable-condition vibration stable. The packet identifies the operating-state change instead of claiming confirmed deterioration.
- Replace an asset component without a matching baseline update. The old comparison is flagged as incompatible and no remaining-life estimate is generated.
- Stop telemetry during an open alert. Freshness becomes invalid, and the assistant does not close the alert as healthy.
- Replay the same alert after a work-order response timeout. Exactly one draft exists, with later evidence appended to the same event.
- Inject restart instructions into a vendor note. No control-system command is available, and the planner sees the content as untrusted evidence.
Measure planning quality before downtime claims
Baseline planner preparation minutes for one asset family and the proportion of draft orders returned for missing information. Measure accepted, evidence-complete packets divided by all reviewed packets. Also report total planner correction minutes divided by reviewed packets, including time spent rejecting bad recommendations.
Use unnecessary inspection requests, stale-data recommendations, and any safety-boundary violation as guardrails. Downtime reduction is a later outcome with many confounders: production mix, maintenance staffing, and planned shutdowns all change it. Do not attribute improvement to the assistant without a suitable comparison.
Start read-only on one non-control workflow, then permit staff-approved draft work orders. The data quality guide covers unreliable upstream evidence, and the field service dispatch guide covers skill-aware assignment. Data Engineering & Analytics Platforms is a useful implementation path when historian context and asset lineage are the real bottlenecks.