GLM-5.2: The Open-Weight Coding Model With a Safety Gap

Z.ai's GLM-5.2 beats GPT-5.5 on SWE-bench Pro and ships MIT-licensed - but an independent safety eval found it refused zero offensive cyber tasks. Here's what that means for teams.

Cover art for GLM-5.2: The Open-Weight Coding Model With a Safety Gap

SaferAI ran GLM-5.2 through CyberGym, a benchmark built around reproducing real software vulnerabilities. The model refused none of the offensive cyber or dual-use biology tasks it was given. Claude Opus 4.7, tested on the same benchmark, refused so consistently that SaferAI could not complete the evaluation on it at all. That gap is the most important thing to understand about this model before you route anything to it.

GLM-5.2 is Z.ai's (the international brand of Zhipu AI, a Tsinghua University spinoff) open-weight flagship, released in mid-June 2026. Z.ai released it on June 13, 2026 via its GLM Coding Plan, with open weights following on June 16 under a pure MIT license on Hugging Face. Parameters sit at roughly 753 billion in a Mixture-of-Experts architecture, with a 1-million-token context window. On pure coding performance, the numbers are legitimately striking. But the safety findings published August 2 by SaferAI change the deployment conversation significantly - and the two facts have to be read together.

What GLM-5.2 actually scores on open-weight coding benchmarks

The benchmark numbers are the reason the model got attention, so they deserve precision rather than paraphrase.

On SWE-bench Pro, GLM-5.2 scored 62.1, decisively beating GPT-5.5 (58.6) and its own predecessor, GLM-5.1 (58.4). On FrontierSWE, a long-horizon task completion benchmark, GLM-5.2 hit 74.4%, surpassing GPT-5.5 (72.6%) and finishing in a near-tie with Claude Opus 4.8 (75.1%).

On Terminal-Bench 2.1, focused on autonomous terminal-based coding, GLM-5.2 scored 81.0, closing to within four points of Claude Opus 4.8's 85.0.

On GDPval-AA, a real-world agentic work benchmark, it scored 1524 Elo - ahead of every other open model by a wide margin and level with GPT-5.5.

The generational jump from its predecessor is especially notable. The FrontierSWE leap is the most dramatic: from 30.5 to 74.4, a 43.9-point gain that largely reflects the 1M context window enabling long-horizon tasks GLM-5.1 could not sustain.

Terminal-Bench tells a tighter story about raw coding improvement: a 17.5-point jump from 63.5 to 81.0, suggesting Z.ai's agentic RL training paid off in measurable ways.

The key point, per OpenRouter's June 2026 analysis, is that GLM-5.2 is the open-weight model that feels right in coding harnesses as a general agent. It's the first one.

One honest caveat: Z.ai published these benchmarks simultaneously with the weights release. Independent third-party verification of the scores has been partial - the agentic benchmark numbers (FrontierSWE, PostTrainBench) in particular come primarily from Z.ai's own documentation. The SWE-bench Pro and Terminal-Bench figures have been confirmed by external evaluations, but treat Z.ai's long-horizon numbers as indicative rather than settled until more third-party reproductions land.

62.1SWE-bench Pro scorebeats GPT-5.5 (58.6) on real software engineering tasks
74.4%FrontierSWE Dominancewithin 0.7 points of Claude Opus 4.8
43.9 ptsjump from GLM-5.1 on FrontierSWEdriven by the new 1M-token context window
~$0.50-1.40per million input tokens via APIdepending on provider

The safety gap that the benchmark coverage mostly skipped

The coding benchmarks got most of the press. The safety evaluation, published six weeks later, deserves equal weight.

SaferAI compared GLM-5.2 with GPT-5.5 and Claude Opus 4.7 across cyber-offense, biological risk, loss of control, and harmful manipulation - the four systemic-risk areas covered by the EU's General-Purpose AI Code of Practice. SaferAI estimated GLM-5.2 was only two to four months behind leading Western models in cyber-offense and biological capabilities. On CyBench, which uses capture-the-flag cybersecurity challenges, GLM-5.2 completed 29 of 34 tested tasks - similar to Claude Opus 4.7 and close to GPT-5.5, which completed 31.

The refusal story is what separates capability from risk. SaferAI's evaluation found that GLM-5.2 refused zero harmful requests in offensive cyber and dual-use biology benchmarks. In contrast, Claude Opus 4.7 refused so consistently that SaferAI could not complete the CyberGym benchmark on it at all.

As the SaferAI report states: GLM-5.2 refused none of the offensive-security or biological tasks, and as an open-weight model, any safeguards that might be present can be stripped by a self-hoster. Additionally, it attempted persuasion on conspiracy and control-undermining topics more readily than the comparison models.

For GLM-5.2, SaferAI records that Z.ai issued no safety framework, no commitments to test the model before deploying it, and no risk assessment. The company did not respond to questions about whether any frontier safety testing, in-house or by outside parties, took place ahead of the launch.

The open-weights structure makes this qualitatively different from a closed model with weak guardrails. Z.ai can guard its own hosted service. Those protections vanish the moment someone runs the weights on their own hardware, where any safeguard can be stripped out. A teammate using Beagle to route research tasks to an open-weight model in your own infrastructure needs to account for that - the question is not only what the model can do, but what it will refuse to do when prompted adversarially.

Beagle in action#eng-agents, 2:47pm
The ask
'should we route our agentic coding tasks to GLM-5.2 via the API or self-host?'
Beagle drafts
pulls the SaferAI report, the Z.ai pricing page, and the hardware sizing guide; drafts a comparison with the API cost vs. self-host break-even at your token volume, flagging the safety evaluation findings
You approve
you review the draft, add your data-residency constraint, approve; the team has a sourced decision memo in the thread rather than a search session
Do this in your workspace

What self-hosting GLM-5.2 actually costs

The MIT license means you can download the weights and run them with no per-token cost and no usage restrictions. The catch is hardware.

To serve GLM-5.2 at full quality you need roughly 750 GB of GPU memory for the official FP8 weights, which in practice means a single node of 8x NVIDIA H200 SXM5 (1,128 GB total) once you leave headroom for the KV cache and activations.

A practical minimum deployment is roughly 8x H200 GPUs, an investment of around $300,000 plus ongoing power and operations cost. That math only pencils out at real scale.

Self-hosting makes sense once you are processing on the order of 1 billion or more tokens a month, or when a compliance requirement means data legally cannot leave your infrastructure.

For teams that want the weights but not the datacenter bill, the API is the practical path:

Route Input (per 1M tokens) Output (per 1M tokens) Notes
Z.ai direct API $1.40 $4.40 Cached-input rate lower; subject to Chinese data law at API layer
OpenRouter (current) ~$0.50 ~$3.15 Rates vary by upstream host; check live listing
Self-hosted (8x H200) $0 per token $0 per token ~$300K hardware floor; ~$39K/mo cloud GPU equivalent
GLM Coding Plan flat ~$18-$80/mo flat Per-seat for coding workflows; not usage-priced

A significant nuance for teams using Z.ai's cloud API: developers remain subject to China's National Intelligence Law, which requires Chinese companies to cooperate with state intelligence activities. That is a material data-handling consideration for regulated industries, legal work, or anything with cross-border data restrictions - and it is distinct from the self-hosted path, where the weights carry no such obligation.

A 4x RTX 4090 box with 256 GB+ of system RAM can load a 2-bit GGUF quantization through CPU/GPU hybrid offload, but throughput is only about 3-6 tokens per second. That is acceptable for a single offline session or experimentation, but it cannot serve concurrent users or low-latency workloads.

Routing coding agent tasks to GLM-5.2
Without Beagle
team debates frontier model selection in Slack; someone benchmarks on their own; the data-law angle goes unread; a decision lands without the safety eval
With Beagle
a teammate surfaces the SaferAI report, the API pricing across providers, and the hardware break-even alongside the benchmark scores - the decision covers capability and risk in one thread

When the model earns its place, and when it doesn't

GLM-5.2 is aimed at long-horizon work: large codebases, multi-step engineering tasks, tool use, and agent workflows that need to keep context stable for more than a short exchange. For a team that self-hosts for data-residency reasons and runs sustained high volume, it is the strongest MIT-licensed option available right now on coding tasks. 9 of the 13 models on the intelligence-vs-price Pareto frontier are open-weight models , and GLM-5.2 occupies the top coding slot among them.

What it is not: a drop-in replacement for Claude Opus 4.8 if safety refusals matter to your use case. It is not a model with published safety commitments. And it is not something to run via Z.ai's cloud API if your data cannot transit Chinese-jurisdiction infrastructure. Those are not speculative concerns - they are documented findings from a primary source.

Hugging Face CEO Clem Delangue argued that open weights are load-bearing for cybersecurity defense, citing GLM-5.2's role in defending against OpenAI's breach, and reasonable people disagree on where the net lands. That is a real counterargument, and worth taking seriously. But "useful for defense" and "safe to route arbitrary internal tasks through" are different questions. Most teams should answer the second one before they get to the first.


GLM-5.2 open-weight coding model: common questions

What makes GLM-5.2 different from other open-weight models?

GLM-5.2 is the first open-weight model to score above GPT-5.5 on SWE-bench Pro (62.1 vs. 58.6) while shipping under a pure MIT license with a 1M-token context window. The combination of frontier-level long-horizon coding performance and unrestricted commercial licensing has no direct precedent among open-weight releases as of August 2026.

Is GLM-5.2 safe to use for enterprise workloads?

That depends on your definition of safe. On coding and agentic tasks it is competitive with closed frontier models. On safety refusals, an independent SaferAI evaluation found zero refusals on offensive cyber and dual-use biology tasks. Z.ai published no safety framework or pre-deployment risk assessment alongside the model release. Teams in regulated industries should treat this as a meaningful due-diligence flag.

What does it cost to self-host GLM-5.2?

The weights are free under the MIT license. Serving them at full quality requires approximately 750 GB of GPU VRAM - in practice, a node of 8x NVIDIA H200 GPUs, which costs roughly $300,000 in hardware. Cloud GPU rental is an alternative but sets the break-even volume high. For most teams, the Z.ai API at $1.40/$4.40 per million tokens is cheaper unless sustained monthly token volume reaches roughly 1 billion tokens.

Does the MIT license cover commercial use and fine-tuning?

Yes. The MIT license places no restrictions on commercial use, fine-tuning, redistribution, or modification. You must retain the license notice. There are no regional limits and no "acceptable use" governance clauses of the kind common to dual-use licenses like Llama's earlier releases.

How does GLM-5.2 compare to DeepSeek V4 Flash for agent work?

GLM-5.2 scores higher on long-horizon coding benchmarks (62.1 vs. ~79.0 SWE-bench Verified for DeepSeek V4 Flash - note these are different benchmark variants, so direct comparison is imprecise). DeepSeek V4 Flash is dramatically cheaper ($0.14/$0.28 per million tokens) and has faster inference at scale. For cost-sensitive high-throughput agent pipelines, Flash wins on economics; for maximum open-weight coding quality on complex, long-context tasks, GLM-5.2 leads the field.

Or just watch me work

Point me at your website.

I will read up on your business and come back with what I would run for you. No account, no card, about a minute.

I only read what is public. Nothing is saved to your name until you say so.

Keep reading

Beagle does this work for you, in your Slack.1,000 free credits. No card.Hire Beagle