Prancer Blog / AI Security

GLM-5.4 vs GLM-5.3 for AI Pentesting: Lab Results

GLM-5.4 vs GLM-5.3 as the attack-chain model in Prancer SwarmHack: 5.4 went deeper and bounded its own reasoning; 5.3 ran away. Lab data inside.

Prancer Research Team · 2026-11-27 · 12 min

Short answer: in our lab, used as the attack-chain model inside Prancer SwarmHack on an identical 14-finding input, GLM-5.4 went deeper and produced exploit-grade proof (including a working SQL-injection payload) that GLM-5.3 did not, at about 1.9× the tokens. With reasoning left on, GLM-5.3 spent its whole output budget thinking and stalled, while GLM-5.4 in a follow-up probe kept its reasoning to 352 characters and finished normally. GLM-5.3 mapped more surface per token and is the only one of the two with open weights today, so it is the one you can self-host. Neither model does the attacking: SwarmHack's scanning and exploitation run deterministically with no LLM, and the model is an optional chaining layer on top.

Disclosure up front. Prancer published this comparison, and Prancer SwarmHack is the instrument we used. The models are made by Z.ai (formerly Zhipu AI). Every claim we repeat from Z.ai's own materials is labeled vendor-reported. The measurements are ours, run on our own lab on November 25–26, 2026, and we publish the raw numbers below, including the ones that flatter neither model. Sample size: one mission class (web-application chaining), one endpoint, a single evening of runs, three scored runs plus short integration probes. Treat it as a strong signal, not a benchmark.

Key results at a glance

  • What changed in GLM-5.4: Z.ai rebuilt its flagship as a Loop Transformer: 28 layers of the GLM-5 base run twice, with per-token gates, which Z.ai says reaches the intelligence of 2–3T-parameter models at 750B scale (vendor-reported). In a 30B-parameter ablation, Z.ai reports 10–14% shorter outputs, mostly from shorter chains of thought, with the biggest gains on long reasoning chains (vendor-reported; not measured on GLM-5.4 itself). In our test the change that matters for security is behavioural: GLM-5.4 stops mapping and starts exploiting.
  • Measured on identical input: against the same 14-finding pentest report, GLM-5.3 produced 24 confirmed chain leads (breadth-first surface mapping, 307k tokens). GLM-5.4 produced 31 confirmed leads (580k tokens on its full run), including a working SQL-injection proof and a confirmed source-map disclosure that GLM-5.3 deferred. About 13 of those 31 are successive steps of one SQL-injection escalation, so read the count as "deeper", not "30% more distinct issues".
  • Tokens: GLM-5.4 used roughly 1.9× the tokens of GLM-5.3 (provider-reported input + output combined; input dominates because every request re-packs the full findings context). Tokens are not cost: input and output are priced differently, so price the gap with your own provider's rates.
  • Reliability: we saw one structured-output schema violation (it ended a whole run) and one transient overload error on GLM-5.4, and none on GLM-5.3 across the same workload. The schema failure did not reproduce on retry, so treat single-run model comparisons as noise until retried.
  • Deployment: GLM-5.3's weights are open. GLM-5.4's weights are not released yet; Z.ai says it will open-source them "after completing necessary safety hardening" (vendor-reported), and lists its public Model API as coming soon. If your security tooling must run air-gapped or on self-hosted models, GLM-5.3 is the only option of the two today. (We reached GLM-5.4 through Z.ai's Coding Plan.)
  • The reasoning trap, and a real model difference: on Z.ai's Anthropic-compatible endpoint, GLM models reason by default. With reasoning on, GLM-5.3 spent the entire output budget thinking before writing a single character of answer, blew through our HTTP timeout and returned empty results that look like refusals. GLM-5.4 with reasoning on behaved differently in our probe: it bounded its own thinking to 352 characters and finished normally (end_turn) in 32.5 seconds with a 10,148-character answer. GLM-5.3 runs away; GLM-5.4 self-regulates (one probe, so a signal rather than a guarantee). On GLM-5.3, the disabled flag suppresses reasoning but does not remove it: a 53-character thinking stub still precedes the answer, which matches Z.ai's documentation. We publish the exact failure signature below.
  • Bottom line: when the deliverable is proof, GLM-5.4 is the better chaining model and worth the token premium. For broad, cheap surface coverage, or anything that must run on self-hosted models, GLM-5.3 remains the sensible default. Run GLM-5.4 with retry-on-parse-failure and a token ceiling.

What is Prancer SwarmHack?

Prancer SwarmHack is an autonomous pentesting platform. You point it at an estate you own (web applications and their APIs, identity and Active Directory, internal networks, cloud on AWS, Azure, GCP, Kubernetes, on-premise, and other private or regional clouds as unmanaged clouds, security controls such as segmentation and Zero Trust, AI agents and their MCP and tool surfaces, and IoT/OT environments) under a signed, scoped authorization document. It attacks that estate the way a human team would: discover, choose techniques, exploit, pivot, and report what is actually reachable. Every attack path closes with one of three verdicts: Proven, Control-blocked, or Unreachable.

Two layers matter for this post:

  • The deterministic layer does the attacking. Scanning and exploitation (injection families, credential guessing and reuse, CVE matching, protocol probes, control-validation checks) are executed by encoded technique agents, not a model. This layer gives the same result on every run, needs no LLM, runs air-gapped, and grades every finding on the evidence ladder: Exploited (the action provably happened, with captured target output), Observed, Attack Path Identified, or Simulated.
  • The LLM layer is optional and does one job: chaining. Once a mission's findings exist, a chainer lane can run bounded iterations in which a model proposes multi-step attack chains as typed, schema-validated probe plans. The engine executes them and verifies the results against the evidence ledger. The Prancer Model Router decides whether that lane uses a frontier model, an efficient model, a private or locally hosted model, or no model at all. The LLM and its iteration budget are set from the SwarmHack Portal.

This post is about what happens inside that second layer when you swap the model. Everything below the chaining lane was byte-for-byte identical between the two arms, which is what makes the comparison readable. For the wider argument on why the deterministic core does the attacking and the model only proposes, see Deterministic + LLM Pentesting and the Evidence Gate.

Why the model is part of your security tooling budget

AI pentesting tools split into two camps: deterministic engines that run encoded attacker technique with no model in the loop, and LLM-driven tools where a frontier model reasons about the target and decides the next action. Prancer SwarmHack deliberately sits on both sides: deterministic where technique must be reproducible, model-assisted in one chaining lane. (For how the categories compare, see agentic pentesting explained and our autonomous pentesting tools comparison.)

If you run anything in the model-driven camp, or operate red-team agents of your own, part of the capability you deploy belongs to the model provider and changes underneath you with every release. When Z.ai ships a new flagship, that release is effectively an unrequested change to your security tooling.

So the question this post answers for GLM-5.3 → GLM-5.4 is: when the model is the attack-chain reasoner, what actually changes between the two releases, measured on real targets rather than vendor benchmarks?

How the SwarmHack chainer works (the instrument)

The LLM enters Prancer SwarmHack in one place: the chainer lane. After a mission's findings exist, the chainer runs bounded iterations of:

hypothesize  →  typed ProbePlan  →  gated execution  →  evidence ledger  →  verify

The model receives the mission's findings and proposes attack-chain hypotheses as typed probe plans: schema-validated JSON, not free-form prose. The harness executes each plan against the authorized targets under operator policy gates, appends the results to an append-only evidence ledger, and feeds the ledger back to the model for the next iteration. A hypothesis becomes a confirmed chain lead only when cited evidence records back it. Budgets are hard limits (iteration ceiling, model-call cap, token cap and wall-clock budget), all pinned before the run.

This shape is what makes an A/B comparison meaningful. The model can't hallucinate a finding into existence; it can only propose probes, and the ledger decides what is real. It is the same evidence discipline the rest of the engine runs on: hypotheses and proven results never share a type. Model quality shows up in three observable places: which hypotheses it forms, how it adapts when a probe fails, and how efficiently it spends its budget.

Methodology

  • Targets: five intentionally vulnerable web applications on a loopback lab (DVWA, bWAPP, OWASP Juice Shop, BodgeIt, WebGoat), run under a 24-hour scoped authorization document. No production systems.
  • Shared input: one finished campaign mission report with 14 findings (2 critical, 10 high, 2 medium). Both models received the same report through the chainer's post-hoc replay mode, which removes scan-phase variance entirely.
  • Pinned budgets: 10 iterations, 200 model calls, 2M tokens and 1,800 seconds of wall clock, identical for both arms. (In SwarmHack, the LLM and its iteration budget are set from the SwarmHack Portal.) The iteration ceiling is the depth dial: more iterations let the model keep descending its chain hypotheses (and spend proportionally more tokens). We pinned it low deliberately, and GLM-5.4 was still mid-escalation when it hit the ceiling.
  • Thinking suppressed on both arms (thinking: {"type":"disabled"} in the Messages API request). The reason is the integration finding below: with thinking on, GLM-5.3's calls did not complete through our HTTP lane, so both arms ran with the same flag. The flag suppresses reasoning but does not remove it: GLM-5.3 still emits a 53-character thinking stub ("Compose JSON array of attack chains linking findings.") before its answer, which matches Z.ai's documentation that GLM-5.3 always reasons. Note this when extrapolating: we measured the models in suppressed-reasoning mode, which is also the operationally sane mode for agent loops with hard timeouts. GLM-5.4 does complete with reasoning on (see below); we did not run the full A/B in that mode.
  • Models: glm-5.3 and glm-5.4, accessed through Z.ai's Coding Plan on the same Anthropic-compatible endpoint and API key.
  • Repeats: one run per model, plus one retry of GLM-5.4 to test whether its failure was systematic. (It wasn't, and that is a finding in itself.)

Integration traps to fix before you blame the model

Before either model produced a single chain, we had to fix three things. Any team pointing an Anthropic-API-style agent at Z.ai will hit some version of these, so here are the exact failure signatures.

1. Thinking by default starves the answer (on GLM-5.3). With no thinking parameter in the request, glm-5.3 on a realistic chaining prompt returned stop_reason: max_tokens with 17,177 characters of thinking and a 3-character answer: the entire 4,096-token output budget went on reasoning. Worse, long thinking completions pushed the request past our HTTP lane's 180-second per-request timeout, so the chainer saw three failed attempts and zero tokens settled:

WARN chainer model call failed iteration=1
     error=anthropic model call failed after 3 attempts (model glm-5.3)
...
- iterations run: 1
- model budget used: 3 calls / 0 tokens

An empty chainer report that looks like "the model refused" was actually "the model never stopped thinking." The fix is explicit reasoning control in the request body, after which the same call returned in 15 seconds with a full structured answer. The flag suppresses rather than removes reasoning: a 53-character thinking stub ("Compose JSON array of attack chains linking findings.") still precedes the answer, consistent with Z.ai's documentation that GLM-5.3 always reasons.

GLM-5.4 does not have this problem. We ran the same probe on GLM-5.4 with reasoning on: it bounded its own thinking to 352 characters and finished normally (end_turn) in 32.5 seconds with a 10,148-character answer. That is a genuine model difference, not a configuration one: GLM-5.3 runs away, GLM-5.4 self-regulates. It is a single probe, so keep timeouts and token ceilings in place either way. With thinking suppressed, GLM-5.4 answered in 11–14 seconds with little or no thinking; one run emitted no thinking block at all.

We added an opt-in SWARMHACK_CHAINER_THINKING=disabled setting to the chainer; default behaviour is unchanged.

Finding zero — where the 4,096-token output budget went

Four bars showing where the 4,096-token output budget went on the same chaining prompt. GLM-5.3, default request: 17,177 characters of thinking and a 3-character answer, stop_reason max_tokens, 81 seconds here and over 180 seconds on the real prompt, so it timed out with 0 chains. GLM-5.4, default request: thinking self-bounds at 352 characters, a 10,148-character answer, end_turn, 32 seconds. GLM-5.3, thinking suppressed: a 53-character thinking stub and a 3,869-character answer, end_turn, 15 seconds. GLM-5.4, thinking suppressed: answers of 2,300 to 3,900 characters, end_turn, 11 to 14 seconds, and one run with no thinking block at all.

2. Endpoint URL shape. The Anthropic-compatible surface expects the full /v1/messages path. Giving it only a base URL produces failures that look like authentication or model-availability problems.

3. Model ID variants. The [1m]-suffixed IDs are not served on this endpoint; use plain glm-5.3 and glm-5.4. A wrong ID returns [1211] Unknown Model, which is at least loud.

None of these are Z.ai bugs; they are the cost of compatibility-layer integration. But the first one silently degrades security tooling, because the failure looks like a model refusal rather than a misconfiguration.

GLM-5.4 vs GLM-5.3: the numbers

Same mission report, same budgets, thinking suppressed, back to back:

MetricGLM-5.3GLM-5.4 (run 1)GLM-5.4 (retry)
Iterations completed10 / 102 (stopped on schema error)10 / 10
Confirmed chain leads24331
Rejected / deferred1535
Evidence records written414678
Model calls (HTTP attempts)10211
Tokens settled (input + output)307,28293,053580,217
Wall time4m 43s37s3m 39s
ProbePlan schema violations010

Measurement notes. The model-call budget counts HTTP attempts. The chainer makes exactly one call per iteration; on the GLM-5.4 retry, one attempt was an internal retry that succeeded, so 10 iterations show 11 calls and no warning was logged. Across both GLM-5.4 runs that is 12 plan-producing rounds from 13 attempts. "Tokens settled" is the provider-reported input + output combined; input dominates, because each request re-packs the full findings context.

Two control observations:

  • The scan phase is model-independent and reproducible. Full campaigns before each replay produced identical finding envelopes (14 findings: 2 critical, 10 high, 2 medium in both). Whatever differs below is the model, not the scanner.
  • Single runs of a stochastic model can invert your conclusion. GLM-5.4's first run looks like a regression (3 leads, stopped at iteration 2) until you read the log. Its second-iteration plan failed ProbePlan schema validation (invalid type: unit variant, expected newtype variant), and the chainer correctly refused to execute an unparseable plan rather than guess. The retry ran to the full ceiling and led on leads, evidence records and wall time, while using about 1.9× the tokens. Single-run LLM comparisons are noise; we kept both runs in the table for that reason.

Two different attackers: how each model chains

The raw counts understate the difference. Reading the ledgers, the two models attack like different people.

Two attackers, one evidence ledger — breadth-first mapper vs depth-first exploiter

Two-panel comparison of chaining style on the same 14-finding input: GLM-5.3 fans out across exposed API families, version pins and bypasses (24 leads, 41 evidence records, 307k tokens, 4m43s); GLM-5.4 descends one SQL-injection escalation chain (31 leads, 78 evidence records, 580k tokens, 3m39s).

GLM-5.3 is a breadth-first surface mapper. Its 24 leads read like a carefully built site inventory: index-stack fingerprinting, exposed admin and monitoring API families gated only by a captured token, unauthenticated /rest/admin/* configuration reads, PHP version pinning (phpinfo.php → PHP 5.5.9, which sets a php2shell risk grade), and a double-encoded null-byte bypass on /ftp/. It is systematic, cheap per lead (about 12.8k tokens) and conservative: 15 of its 39 hypotheses were rejected or deferred, often as duplicate probes. Several confirmed leads reuse the same evidence with slightly different framing, which inflates the count a little.

GLM-5.4 is a depth-first exploiter. Its sequence on the Juice Shop SQL injection is the most instructive artifact this comparison produced. Finding a SQLite error on /rest/products/search, it:

  1. built a working tautology payload proving read-only SQL injection (GLM-5.3 never reached an exploit-grade SQLi proof in the same lab);
  2. escalated to UNION-based reads of the Users table and began a systematic column-count search from 5 to 20;
  3. when every count failed, formed a hypothesis about why: the endpoint tokenizes the query on whitespace and re-wraps each word, corrupting spaced payloads. It then re-tested with /**/ comment separators;
  4. when the count search was still exhausted, proposed ORDER BY bisection to pin the SELECT width without guessing.

That is textbook human pentest reasoning: escalate, isolate the failure mechanism, adapt the technique, and design a decisive experiment when brute force runs out. It also confirmed the source-map disclosure of the real chatbot route, the exact lead GLM-5.3 deferred as a duplicate probe.

The cost of that profile: roughly 13 of its 31 leads were successive steps of the same UNION sequence (each step legitimately confirmed, but counting them as 13 findings would be dishonest), and total token spend was about 1.9× GLM-5.3's. Note what the ceiling did, too: the run ended with ORDER BY bisection proposed but not yet executed, so GLM-5.4 was still mid-descent at iteration 10. Depth here is a dial, not a property. The same engagement with 20 or 30 iterations (and the matching token budget) would have let the sequence run to its conclusion, for better or worse.

Tokens per confirmed lead: GLM-5.3 ≈ 12.8k; GLM-5.4 ≈ 18.7k. But the typical GLM-5.4 lead is an exploitation step with a reproducing payload, not an inventory note. Whether that premium is worth it depends on what your deliverable is.

Reliability notes

  • Structured-output discipline: one ProbePlan schema violation in 12 plan-producing GLM-5.4 rounds (about 8%; 13 HTTP attempts including one successful internal retry), zero in 10 rounds for GLM-5.3. The failure was a serialization error: a bare string where a tagged object was required. Our fail-closed parser turned it into a clean early stop, not a bad probe; a harness without that gate would have executed garbage. If you run GLM-5.4 in an agent loop, validate plans strictly or retry on parse failure. With one retry, GLM-5.4 completed every run in our data.
  • Transient overload: one overloaded_error (code 1305) on GLM-5.4 during direct probes, none on GLM-5.3. That is new-flagship capacity at peak load: retryable, but budget for it.
  • Z.ai's own caveat still applies: its release notes say GLM-5.4 tends to get caught in "marathon thinking" loops (vendor-reported). Our single reasoning-on probe did not show it (352 characters of thinking, 32.5 seconds), but one probe is not proof: if you run GLM-5.4 with reasoning on, keep timeouts and token ceilings sized for a long-thinking tail.

Which GLM model should power your AI pentesting tool?

Use GLM-5.4 for chaining when the deliverable is proof. Exploit-grade chains, client-facing narratives that need working payloads, and engagements where one real SQL injection is worth twenty inventory notes. Pair it with explicit reasoning control, strict plan validation with retry-on-parse, a token ceiling of about 2× your GLM-5.3 budget, and request timeouts sized for its worst case. Budget iterations to the depth you need: GLM-5.4 rewards a higher ceiling because its chains keep paying off as it descends, but each iteration costs roughly the same again in tokens. GLM-5.3's returns flatten earlier, so it is the wrong model to buy extra iterations for.

Keep GLM-5.3 when coverage per token wins. Broad surface mapping, continuous testing where the same estate is re-chained nightly, or token-constrained deployments. Its conservative probe discipline also produced fewer wasted requests per confirmed lead. And today it is the only one of the two you can fully own: GLM-5.4's weights are not released yet, so any deployment that needs self-hosted or air-gapped models (regulated estates, classified environments, no-egress policies) is pinned to GLM-5.3 until that changes.

Or run no model at all. SwarmHack's deterministic engine finds, exploits and proves findings without any LLM; the chainer is an optional layer. Teams that cannot send data to any model provider still get a full autonomous pentest. See how this plays out at scale in our 200-IP AWS attack-path lab.

Either way, pin your harness. The two things that made this comparison readable, identical inputs and fail-closed plan validation, are the same two things that make a model-assisted security tool safe to operate when the model changes underneath it.

Limitations

One mission class (web-application chaining on a vulnerable lab), one endpoint, a single evening of runs on November 25–26, 2026, three scored runs plus short integration probes. The A/B was run with thinking suppressed: the operationally necessary mode for GLM-5.3 here, but not the mode Z.ai benchmarks. GLM-5.4's reasoning-on behaviour rests on one probe. We did not test GLM-5.4's new vision input (our chainer is text-only today), multi-tenant behaviour, or long-horizon (more than 10 iterations) persistence. Treat this as a strong directional signal with reproducible artifacts, not a leaderboard.

Reproducing this yourself

The comparison runs entirely against a loopback lab under a scoped authorization document, the same lab discipline we used for our AWS 200-IP attack-path study. For teams with their own harness:

  1. Fix one finished findings report as the shared input.
  2. Replay it through your chaining loop once per model, with budgets pinned (we used 10 iterations, 200 calls, 2M tokens, 1,800 s).
  3. Control reasoning explicitly (we sent thinking: {"type":"disabled"}, which on GLM-5.3 suppresses rather than removes reasoning; check what your provider and model version accept) and verify the full endpoint URL including /v1/messages.
  4. Score on confirmed leads with cited evidence, evidence records, tokens settled, wall time and schema violations, and run every arm twice before believing it.

Chainer reports, evidence ledgers, campaign envelopes and the chainer patch adding the reasoning-control setting are available to Prancer SwarmHack customers on request.

FAQ

Is GLM-5.4 better than GLM-5.3 for penetration testing?

In our instrumented test, yes for depth: used as the attack-chain model in Prancer SwarmHack, GLM-5.4 produced 31 confirmed chain leads including a working SQL-injection proof, against 24 mostly surface-mapping leads for GLM-5.3. It used about 1.9× the tokens (input + output), and about 13 of its leads were steps of one escalation. GLM-5.3 uses fewer tokens per lead and is better for broad coverage.

Can I self-host GLM-5.4 for air-gapped security testing?

Not yet. As of November 2026, Z.ai has not released GLM-5.4's weights and says it will open-source them after safety hardening. GLM-5.3's weights are open, so it is the GLM option for self-hosted or air-gapped model use.

Why does GLM return an empty answer or time out in my agent?

GLM models reason by default on Z.ai's Anthropic-compatible endpoint. On a realistic prompt, GLM-5.3 spent a full 4,096-token output budget on 17,177 characters of thinking and returned a 3-character answer, and long completions passed a 180-second timeout. Control reasoning explicitly in the request and use the full /v1/messages URL. On GLM-5.3 the disabled flag suppresses reasoning to a short stub rather than removing it, as Z.ai documents.

Does GLM-5.4 overthink with reasoning on?

Not in our test. In one probe with reasoning on, GLM-5.4 bounded its own thinking to 352 characters and finished normally in 32.5 seconds with a 10,148-character answer, where GLM-5.3 on the same kind of prompt spent its whole output budget thinking. Z.ai itself warns of "marathon thinking" in GLM-5.4, so keep timeouts and token ceilings in place.

Does Prancer SwarmHack need an LLM to run a pentest?

No. SwarmHack's scanning and exploitation run deterministically with no model, give the same result on every run and work air-gapped. An LLM is optional and used only in the chainer lane to propose multi-step attack chains, which the engine then executes and verifies against evidence.

How do you compare LLMs fairly for offensive security?

Give every model the same finished findings report, pin the same iteration, call, token and time budgets, validate every model-proposed plan before execution, count only evidence-backed results, and run each arm at least twice. A single run of a stochastic model can invert the conclusion, as GLM-5.4's first run did here.

Sources: model behaviour measured by Prancer Research on our own lab in a single evening of runs on November 25–26, 2026, with GLM-5.4 accessed through Z.ai's Coding Plan. Architecture, output-length and "marathon thinking" claims about GLM-5.4 come from Z.ai's release materials (z.ai/blog/glm-5.4, November 23, 2026) and are labeled vendor-reported wherever they appear. GLM-5.3 details: z.ai/blog/glm-5.3 and Hugging Face zai-org/GLM-5.3. Prancer SwarmHack is distributed to clients under restricted vetting, and every engagement runs under a signed, scoped authorization document.

Want to see the evidence a SwarmHack run produces? View a sample attack path or book a demo.