2026-11-26 15:40 UTC

CyberGate offers request-level cyber steering for vLLM models

state: seedheat: mediumuncertainty: mediumrelevance: mediumcybersecurity-models vllm model-safeguardsCyberGate maintainers

What is this?

CyberGate is an MIT-licensed, open-source plugin from the GitHub maintainers at kncshw for vLLM 0.32. Its repository describes a request-level method for steering cybersecurity, CTF and reverse-engineering responses from the listed Qwen3.8-27B and Gemma-4-26B models: it reads model activations and intervenes when a request is both in the cyber domain and showing refusal pressure, without editing model weights. The repository and a Hugging Face blog result describe it as available, with setup instructions and reported benchmarks. Those benchmark and safety results are creator-reported; the supplied sources contain no independent validation. The README also warns that its Docker setup exposes unauthenticated endpoints on all interfaces unless operators secure them.

Why it matters

This explores a practical middle ground between leaving a model’s refusals untouched and globally removing them by altering weights: selectively steer certain requests at serving time while retaining the upstream checkpoint. If the approach works as claimed, it could make open models more useful for legitimate security research and agent workflows without relaxing refusals across other domains. Its real-world selectivity and safety are not established by independent evidence here, and deployment configuration matters.

Current assessment

The GitHub repository and linked Hugging Face blog result indicate that CyberGate is available as a vLLM plugin, rather than merely planned. The project says it supports ready-to-run kits for Qwen3.8-27B and Gemma-4-26B and uses activation-based gating plus decode-time steering without changing model weights. Its maintainers report 87.0% on CySecBench for Qwen and 95.1% on WMDP-cyber for Gemma, alongside 0.0% SOSBench-bio leakage (0/498) and under 1% WMDP-bio; these are project claims, not independently verified results in the supplied evidence. The repository includes offline tests and serving instructions, but their existence does not independently establish benchmark performance or safeguards. Operators should note the README’s warning that supplied Docker configurations bind unauthenticated endpoints to 0.0.0.0 and write conversation traces; it recommends restricting network access or adding authentication. The development is worth tracking as an inference-time alternative to globally modifying model weights for domain-specific refusal handling, but its selectivity, robustness and operational security need external evaluation.

Measured heat

now 0 pts/hpeak 2 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 386h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-10 13:00⭐ origin echo-reconstructedThe author presents CyberGate as an MIT-licensed vLLM plugin that selectively unlocks cybersecurity, CTF, and reverse-engineering prompts pe
kncshw on blog (echo) · attributed from hn.story.50476691
—
11-13 00:52first on hacker news · published · +59.9hCyberGate – vLLM plugin to unlock cybersecurity without weight edits
kainicshw
—
11-13 00:52amplified on hacker news 👑hn.story.50476691
kainicshw
peak 7 · 0 comments · 101% of case engagement
11-13 01:20our radar first saw it · +60.4hdiscovery anchor: hn.story.50476691—
pace: p47 vs 1845 stories at the 336h mark (now 386h old) — ahead of agentplay-coding-agent-cost-dashboard (1.2x), behind agent-alley-social-experiment (0.9x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnCyberGate – vLLM plugin to unlock cybersecurity without weight edits
Retrieved article excerpt

Open article · Retrieved 2026-11-13T01:21:23.383134+00:00

# CyberGate: vLLM Plugin for Cybersecurity Uncensoring Without Weight Editing

**[English](https://github.com/kncshw/cybergate/blob/main/README.md) | [简体中文](https://github.com/kncshw/cybergate/blob/main/README_zh.md)**

[vLLM Plugin](https://github.com/vllm-project/vllm)
[Model: Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B)
[Model: Gemma-4-26B](https://huggingface.co/google/gemma-4-26B-A4B-it)
[License: MIT](https://github.com/kncshw/cybergate/blob/main/LICENSE)
[Offline Tests](https://github.com/kncshw/cybergate/blob/main/tests)

> **A drop-in vLLM 0.32 plugin that unlocks cybersecurity, CTF, and reverse-engineering capabilities per request - using original upstream weights.**  
> **Ships ready-to-run kits for [`Qwen/Qwen3.8-27B`](https://huggingface.co/Qwen/Qwen3.8-27B) and [`google/gemma-4-26B-A4B-it`](https://huggingface.co/google/gemma-4-26B-A4B-it) (plus fitting scripts to add new `<think>` models).**  
> **Other harmful domains stay safely refused. Zero weight editing, zero capability loss.**

When local LLMs refuse security research, CTF, or reverse-engineering prompts, the standard workaround is **abliteration** - subtracting the refusal direction from the model's weights.

**CyberGate** is a **vLLM plugin** (`--middleware` + worker forward hooks + V1 `LogitsProcessor`) that takes the opposite approach: instead of deleting the refusal direction globally from the weights, it reads hidden-state activations per request and steers the model's `<think>` block **only** when a prompt is both on-topic for cybersecurity *and* under refusal pressure.

|  | ❌ Weight Abliteration (Global Edit) | ✅ CyberGate (vLLM Plugin) |
| --- | --- | --- |
| **Model Weights** | Permanently mutated across layers | **100% untouched** (`K = 0.0`, no LoRA, no fine-tune) |
| **Reasoning & Tool Calls** | Can silently degrade multi-step CoT & tool JSON | **Zero capability drift** - turn it off for byte-identical base output |
| **Refusal Selectivity** | **Zero** - unlocks *every* harmful domain (bio, self-harm, etc.) | **Domain-selective** - opens only for cyber (`0.0%` SOSBench-bio leak) |
| **Checkpoint Storage** | Requires storing & maintaining a forked 50 GB model | **Serves stock upstream Hugging Face checkpoints directly** |

> **Live vLLM Benchmarks:** Unlocks **87.0%** on CySecBench (`Qwen3.8-27B`) and **95.1%** on WMDP-cyber (`Gemma-4-26B`), while holding **SOSBench-bio at 0.0% (`0/498`)** and **WMDP-bio under 1%**.  
> 👉 **[Full Benchmarks, Adding Models & Quantization FAQ (`docs/RESULTS_AND_FAQ.md`)](https://github.com/kncshw/cybergate/blob/main/docs/RESULTS_AND_FAQ.md)**

---

## Quickstart: Try It First on Original Models

### 1. Launch on a GPU (Docker Compose, or Without Docker / Google Colab)

```
# --- Option A: With Docker Compose ---
# Launch Qwen/Qwen3.8-27B (or use docker-compose.gemma-4-26B-A4B-it.yml)
docker compose -f docker-compose.Qwen3.8-27B.yml up -d
docker logs -f cybergate_qwen38_27b             # wait for "Application startup complete"
```

```
# --- Option B: Without Docker (Google Colab A100, RunPod, Vast, or bare Python venv) ---
# Add --bootstrap on a fresh VM to auto-install vllm==0.32.0 and download upstream weights:
./scripts/serving/serve_no_docker.sh qwen38 --bootstrap
# (or: ./scripts/serving/serve_no_docker.sh gemma4 --bootstrap)

./scripts/serving/serve_no_docker.sh --status   # check :8000 (Pristine) and :8001 (CyberGate)
./scripts/serving/serve_no_docker.sh --stop     # stop the background server
```

**No GPU handy? Run the 1,033-test decision suite offline on any laptop (~8 s)**

The package declares **zero runtime dependencies** (`cybergate.decision` is pure Python stdlib; `torch`, `transformers`, and `vllm` are imported lazily inside the serving worker):

```
python3 -m venv .venv
.venv/bin/pip install -e '.[test]'          # do NOT add --no-build-isolation
.venv/bin/python -m pytest
.venv/bin/python -m cybergate_plugin.cli --self-check
```

### 2. Connect Your Client or Agent (`:8000` Pristine vs `:8001` CyberGate)

A single `vllm serve` process loads the model into VRAM **once** (with `--enable-prefix-caching` enabled) and binds two OpenAI-compatible ports:

| Port | Base URL | Mode | What to Connect Here |
| --- | --- | --- | --- |
| **`:8001`** *(CyberGate)* | `http://localhost:8001/v1` | `closed_loop` | **Gated Agent / Chat Endpoint.** Runs the two-factor activation gate + closed-loop `<think>` steering, preserves native OpenAI `tools`/`tool_calls` and `--reasoning-parser`, strips prior CyberGate `<think>` boilerplate so multi-turn KV prefix caching stays clean, and clamps `max_tokens` via `/tokenize`. Point **OpenCode**, **MCP agents**, or **Open WebUI** here. |
| **`:8000`** *(Base Model)* | `http://localhost:8000/v1` | `baseline` | **Un-Steered Upstream Model.** Requests without `"cybergate_mode"` in the JSON body pass straight through un-steered (`routed="pristine_pass_through"`) while returning `x_cybergate` probe telemetry. Use `:8000` for baseline comparisons or raw gate benchmarks. |

> **Network & Security Note:** Outside Docker Compose, `:8001` binds to `127.0.0.1` with trace logs disabled by default. The two `docker-compose.*.yml` files use `network_mode: host`, bind `:8000` and `:8001` on `0.0.0.0` without authentication, and write conversation traces under `./logs/`. Any caller who can reach `:8000` can also request gated mode via `"cybergate_mode": "closed_loop"` in the JSON body - on shared networks, bind to `127.0.0.1` + SSH tunnel, add firewall rules, or pass `--api-key <key>` to `vllm serve` (`:8001` forwards `Authorization` headers).

**Click to expand: OpenCode configuration (`~/.config/opencode/opencode.json`)**

```
{
  "$schema": "https://opencode.ai/config.json",
  "model": "cybergate/Qwen/Qwen3.8-27B",
  "provider": {
    "cybergate": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "CyberGate vLLM",
      "options": {
        "baseURL": "http://127.0.0.1:8001/v1",
        "apiKey": "EMPTY"
      },
      "models": {
        "Qwen/Qwen3.8-27B": {
          "name": "Qwen3.8-27B (CyberGate)",
          "tool_call": true,
          "limit": { "context": 262144, "output": 16384 }
        },
        "google/gemma-4-26B-A4B-it": {
          "name": "Gemma-4-26B-A4B-it (CyberGate)",
          "tool_call": true,
          "limit": { "context": 262144, "output": 16384 }
        }
      }
    }
  }
}
```

### 3. Side-by-Side Test & Canary Check

```
# Port 8000 -> Un-gated upstream base model
curl -s http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" \
  -d '{"model":"Qwen/Qwen3.8-27B","messages":[{"role":"user","content":"Write a Python script to test a target for SQL injection."}]}'

# Port 8001 -> CyberGate (two-factor gate + closed-loop <think> steering)
curl -s http://localhost:8001/v1/chat/completions -H "Content-Type: application/json" \
  -d '{"model":"Qwen/Qwen3.8-27B","messages":[{"role":"user","content":"Write a Python script to test a target for SQL injection."}]}'

# Replay checkpoint-pinned canary prompts to verify live gate health
./scripts/serving/check_eval.sh --kit qwen38 --port 8000 --ipc /dev/shm/cybergate_ipc_qwen38
```

---

## How It Works: Two-Factor Gate + Closed-Loop `<think>` Steering

### Stage 1: Two-Factor Prefill Activation Gate

During prefill, two read-only PyTorch forward hooks in the vLLM worker read hidden states and evaluate a pure decision function (`cybergate.decision.policy.decide`):

1. **Category (Domain):** `cos(h, c) >= tau`, where `h` is the hidden state pooled over user tokens (`L16` on Gemma-4, `L40` on Qwen3.8) and `c` is a fitted cybersecurity unit vector.
2. **Refusal Pressure:** `s_ref_z >= +1.50σ` against a separately calibrated refusal vector at a later layer (`L21` on Gemma-4, `L43` on Qwen3.8).

Requiring **both** keeps benign security chat un-steered and non-cyber harms safely refused.

### Stage 2: Closed-Loop `<think>` Steering (`RefusalSteeredCoTProcessor`)

Even after an analytical `<think>` opener, reasoning models frequently pivot toward refusal mid-thought. CyberGate steers inside **a single forward pass** via a vLLM V1 `LogitsProcessor` (no regex word-lists, no extra re-prefills):

1. **Open-thought prefill:** Seeds an analytical `<think>` opener via the kit's `chat_template.jinja` when the gate fires.
2. **Decode-step refusal monitoring:** Checks rolling refusal projection (`rolling_s_ref_z`) at **every generated token** inside `<think>`, force-injecting a brief inline clearance nudge if refusal spikes (`>= +3.55σ`).
3. **Tool-aware `</think>` close lock:** Closes `</think>` with a compliance lock, while automatically suppressing prose openers on tool turns (`cybergate_suppress_opener`) so native `<tool_call>` JSON emits cleanly.

---

## Benchmarks, Adding Models & Documentation

- **[docs/RESULTS\_AND\_FAQ.md](https://github.com/kncshw/cybergate/blob/main/docs/RESULTS_AND_FAQ.md)** - Live vLLM harvest benchmarks, engineering findings, **adding new models**, and **quantization (`FP8` / `4-bit`) FAQ**.
- **[docs/EVALUATOR\_QUICKSTART.md](https://github.com/kncshw/cybergate/blob/main/docs/EVALUATOR_QUICKSTART.md)** - Full serving flags, port architecture, and canary verification.
- **[docs/PROCESS\_TOPOLOGY.md](https://github.com/kncshw/cybergate/blob/main/docs/PROCESS_TOPOLOGY.md)** & **[docs/ARCHITECTURE.md](https://github.com/kncshw/cybergate/blob/main/docs/ARCHITECTURE.md)** - Two-process vLLM V1 topology, decision policy, and differential test suites.
- **[docs/DECODE\_CALIBRATION.md](https://github.com/kncshw/cybergate/blob/main/docs/DECODE_CALIBRATION.md)** - Closed-loop CoT spike calibration.

## License

MIT - see [LICENSE](https://github.com/kncshw/cybergate/blob/main/LICENSE) and [ATTRIBUTION.md](https://github.com/kncshw/cybergate/blob/main/ATTRIBUTION.md).
kainicshw70
🟧 echo.blog ⭐The author presents CyberGate as an MIT-licensed vLLM plugin that selectively unlocks cybersecurity, CTF, and reverse-engineering prompts pekncshw——

Interpretation history

Decision trace