Mainframes still process 70% of global transactions, but they have zero native agent tooling. No JSON. No REST. No streaming interfaces. Just TN3270 screens, COBOL source, JCL job control language, and security managers that predate OAuth by three decades.
Hypercubic’s Hopper demonstrates how to expose these systems to LLM agents without rewriting the business logic that runs insurance claims, airline reservations, and banking ledgers. The plumbing is harder than it looks.
The Tool Boundary Problem
Modern agent frameworks assume you can serialize state into JSON schemas, call idempotent HTTP endpoints, and handle errors with retries. Mainframes break every assumption:
- State lives in VSAM files and DB2 tables with no native serialization format
- Operations happen through TN3270 screen flows that require navigation sequences
- JCL job submissions trigger batch processes that can’t be rolled back
- CICS transactions hold locks and can’t be replayed without side effects
You can’t just wrap a mainframe in an OpenAPI spec and call it a tool.
Hopper’s Architecture
Hopper runs as a Windows desktop agent that drives TN3270 emulation, parses mainframe artifacts, and exposes operations through an LLM-friendly interface. The key components:
| Component | Function | Boundary Constraint |
|---|---|---|
| TN3270 driver | Navigate ISPF menus, read screens, submit commands | Must handle 3270 data streams, EBCDIC encoding, screen scraping |
| Source parser | Read COBOL, JCL, assembler, PL/I | No AST libraries exist; must parse 60-year-old syntax variations |
| Job orchestrator | Submit JCL, monitor spool output, retrieve results | Jobs can’t be canceled once started; must track dependencies |
| Security bridge | Map agent credentials to RACF/Top Secret/ACF2 | Mainframe security predates API keys; uses userid/password/resource profiles |
| State serializer | Convert VSAM records, DB2 rows, spool output to JSON | Fixed-width fields, packed decimals, no schema metadata |
The agent doesn’t call REST endpoints. It types into virtual terminals and waits for screen updates.
Authentication and Authorization
Mainframes use resource-based security managers (RACF, Top Secret, ACF2) that grant access to datasets, transactions, and programs based on userid profiles. There’s no token exchange or OAuth flow.
Hopper’s approach:
- Agent runs with user credentials tied to a mainframe userid
- Every TN3270 session authenticates with that userid/password
- Resource access follows existing RACF profiles (no new permission model)
- Audit trails flow through standard SMF records
This preserves the security boundary. The agent can’t do anything the user couldn’t do manually. But it creates a new problem: how do you handle approval workflows when the agent wants to submit a JCL job that drops a production table?
Idempotency and Rollback
LLM agents retry failed operations. Mainframe operations often can’t be retried:
- JCL job submission starts a batch process that writes to files, updates databases, sends messages
- CICS transaction calls acquire locks, update shared memory, trigger downstream systems
- Dataset allocation reserves disk space that can’t be reclaimed until the job ends
Hopper’s mitigation strategy:
*----------------------------------------------------------------
* HOPPER-SAFE: Mark operations that can be retried
*----------------------------------------------------------------
IDENTIFICATION DIVISION.
PROGRAM-ID. SAFE-READ.
*> READ-ONLY: Can retry without side effects
IDENTIFICATION DIVISION.
PROGRAM-ID. UNSAFE-UPDATE.
*> WRITES-DATA: Requires approval before execution
*> ROLLBACK: Manual compensation required
The agent tags operations as read-only, idempotent, or requiring approval. For non-idempotent operations, Hopper:
- Generates a preview of what the operation will do
- Requests human approval before execution
- Logs the operation to an audit trail
- Provides compensation steps if rollback is needed
There’s no automatic undo. The agent must know which operations are safe to retry and which require human judgment.
State Serialization
COBOL data structures use fixed-width fields, packed decimals (COMP-3), and binary integers (COMP). A customer record might look like:
01 CUST-RECORD.
05 CUST-REGION PIC X(4).
05 CUST-ACCOUNT PIC X(10).
05 CUST-NAME PIC X(30).
05 CUST-BALANCE PIC S9(7)V99 COMP-3.
The balance field is a signed 7-digit number with 2 decimal places, stored in packed decimal format (4 bits per digit, sign in the last nibble). There’s no JSON equivalent.
Hopper’s serializer:
- Parses COBOL copybooks to extract field definitions
- Converts EBCDIC to ASCII for text fields
- Unpacks COMP-3 decimals to floating-point numbers
- Generates JSON schemas with type hints for the LLM
The LLM sees:
{
"region": "EAST",
"account": "1234567890",
"name": "ACME CORPORATION",
"balance": 12345.67,
"_meta": {
"balance_format": "COMP-3",
"balance_precision": "S9(7)V99"
}
}
The metadata helps the agent understand precision limits and rounding behavior.
Observability
Mainframe operations don’t emit OpenTelemetry spans. Hopper instruments the agent layer:
- TN3270 screen captures logged for every navigation step
- JCL job output (spool files) captured and indexed
- CICS transaction traces parsed from system logs
- Agent reasoning logged with tool calls and responses
The observability stack runs outside the mainframe. You can’t install Prometheus exporters on z/OS.
Deployment Shape
Hopper runs as a desktop agent on Windows. It’s not a cloud service. The reasons:
- TN3270 emulation requires Windows COM objects (HLLAPI or EHLLAPI)
- Mainframe connectivity often happens through VPN or direct network access
- Security policies prohibit routing mainframe traffic through third-party clouds
- Latency matters when driving screen flows (round-trip time adds up)
The agent runs on the user’s machine, connects to the mainframe over the corporate network, and calls LLM APIs for reasoning. State stays local.
Likely Failure Modes
Screen scraping brittleness: TN3270 screen layouts change when mainframe applications are updated. The agent’s navigation logic breaks. Mitigation: version screen definitions and detect layout changes.
Job dependency deadlocks: Agent submits JCL jobs that wait for resources held by other jobs. The batch queue stalls. Mitigation: parse JCL dependencies and check resource availability before submission.
CICS transaction timeouts: Agent-driven transactions hold locks longer than human-driven flows. CICS aborts the transaction. Mitigation: break long operations into smaller transactions with intermediate commits.
RACF permission drift: User’s mainframe access changes, but agent cache is stale. Operations fail with authorization errors. Mitigation: refresh security profiles on every session start.
Packed decimal overflow: Agent generates numbers that exceed COMP-3 field limits. COBOL program abends. Mitigation: validate numeric ranges against copybook definitions before submission.
Technical Verdict
Use Hopper when:
- You need to automate mainframe operations without rewriting COBOL programs
- Your team has deep mainframe knowledge and can handle approval workflows
- Security policies require on-premises execution with existing RACF controls
- You’re willing to maintain screen definitions and handle scraping brittleness
Avoid when:
- You can modernize the mainframe interface with REST APIs or message queues
- Your operations require sub-second latency (screen flows are slow)
- You need fully autonomous agents (approval gates break autonomy)
- Your mainframe environment changes frequently (screen scraping is fragile)
The hard part isn’t the LLM integration. It’s bridging 1960s security models, non-idempotent operations, and stateful screen flows into a tool interface that agents can reason about. Hopper shows it’s possible, but the plumbing is specific to environments where rewriting legacy systems isn’t an option.