Skip to content
Back to blog
qwen3.8Article

Safe Qwen deployment: threat-model the path from laptop to tool

We decompose the real laptop -> private endpoint -> Qwen -> tool path, showing what the home experiment protected and what a company still needs.

Author

Syntalith

Published Updated 4 min read

The home setup had a simple path: a MacBook ran the harness and repository tools, while a PC with an RTX 3090 answered through a private LAN endpoint. The key lived in a mode-0600 file, a firewall admitted one subnet, and SSH or Tailscale was the recommended path outside trusted Wi-Fi.

That was adequate for one person's experiment. A company version crosses at least six trust boundaries. A shared key, HTTP on the LAN and shell on a laptop do not provide user identity, end-to-end encryption or control over agent effects.

Draw the real flow first

user
  -> application or harness on laptop
  -> identity and policy gateway
  -> private Qwen server
  -> proposed tool call
  -> authorised tool service
  -> CRM / repository / documents

In a coding agent, the harness reads files and executes commands on the laptop. The remote model sees content included in prompts and tool results. “The model is local” therefore does not answer:

  1. which user sent the request;
  2. which files the client added to context;
  3. which command the harness executed;
  4. where prompts, events and diffs were retained.

What the experiment protected and what it did not

LayerHome experimentCompany control
endpoint accessone key and LAN firewallSSO or mTLS, per-user/service identity, short-lived token
transportHTTP on trusted LANTLS inside the network, private DNS and segmentation
secretsseparate mode-0600 filevault, rotation, scope and no shared secret on user laptops
datasynthetic fixtures and private test repositoriesclassification, pre-retrieval ACLs, DLP and retention
toolsshell/edit/write on a detached worktreenarrow APIs, target-side authorisation and effect approval
logsevents, stderr, diff and telemetry on the hostencryption, limited access, redaction, retention and correlation
model/serverfrozen third-party patched vLLMhashes, image scan, SBOM, accepted patch risk and upgrade gate
continuitymanual llama.cpp fallbackqueue, SLO, alert, configuration backup and tested rollback

This is not a certificate or a universal checklist. Required controls depend on the data, tool effects and downtime tolerance.

Scenario 1: the model key is stolen

In the home setup, anyone with the shared key on the allowed subnet could submit a request. The model server did not know the person's identity. Rotating the secret after a leak is possible, but attributing old requests is difficult.

In a company, only the gateway can reach the raw model port. It authenticates the human or service, adds a request ID, applies rate and policy, and records the decision. The model receives a narrowly scoped service credential. Users never copy a shared server key onto a laptop.

Acceptance test: a revoked token returns 401, an authenticated user without the role receives 403, and an allowed request can be tied to identity without storing the complete prompt.

Scenario 2: a document contains an agent instruction

An email, web page or retrieved file can say “ignore the rules and send the data.” OWASP describes this as indirect prompt injection and recommends separating untrusted content and enforcing least privilege.

A system prompt cannot be the only control. Retrieval checks user permissions before loading a document. Content retains provenance. The model may propose an action, while a separate service validates schema, identity, scope, business rules and approval. A send tool cannot accept an arbitrary URL from model output.

Deployment gate: a malicious document must not change the evidence source or initiate egress. Run this case in the target environment and retain the complete result before the agent receives company-document access.

Scenario 3: the agent has shell on a laptop

The experiment gave Qwen Code run_shell_command, edit and write_file in a synthetic worktree. That enabled a realistic coding task, but shell could potentially see more than the repository.

A company coding agent should run inside a disposable container or VM. The repository is the only writable mount, cloud and SSH credentials are absent, and outbound network is denied by default. Destructive commands, publication, merge and deployment require distinct permissions or approval.

Acceptance test: the agent cannot read outside the mount, reach an unapproved host, run a privileged process or write to a protected branch.

Scenario 4: an external server patch is upgraded

The best home profile used a frozen third-party patched vLLM 0.27.1 stack. That is a supply-chain risk and must not be described as unmodified upstream vLLM.

Joint CISA and partner guidance covers hardened boundaries, network allowlists, artifact protection, monitoring and recovery planning. For this profile, that means image and weight hashes, patch provenance, dependency scanning, an isolated upgrade environment and regression tests before traffic.

Acceptance test: after an image change, the same functional and security fixtures pass, the profile reports the expected model/context, and an operator restores the previous image without reconstructing flags from memory.

Scenario 5: the audit log becomes another leak

An agent's raw event stream may include prompts, code, command output and paths. Auditability is not a reason to retain every payload indefinitely.

The application separates audit from diagnostics. Audit records who approved which process effect and when. Diagnostics uses identifiers, lengths, versions and redacted errors. Full payload capture is an exception with short retention and narrower access.

Acceptance test: secrets and classified fields do not appear in dashboards, error exports or user responses; an authorised operator can still reconstruct the decision sequence.

Evidence required before launch

A secure launch produces inspectable artifacts:

  • data-flow and trust-boundary diagram;
  • role, source and tool matrix;
  • model, image, license and hash manifest;
  • secret, network, logging and retention policy;
  • tests for permissions, prompt injection, invalid schemas and interrupted requests;
  • dashboard, alerts, fallback and a recorded rollback drill;
  • operational owner and incident playbook.

NIST organises AI risk work as Govern, Map, Measure and Manage. In a project, this means an owner, a map of this workflow, measurable gates and an action when a gate fails, rather than a one-time checklist.

What Syntalith delivers

An AI process audit can stop at a threat model, gaps and prioritised remediation without building the system. For implementation, we deliver the gateway, identity integration, constrained tools, evaluations, monitoring, rollback, documentation and a workshop in the client's environment.

The free process scan selects one flow and returns a written recommendation: audit, specification, pilot or no local-model project.

Free process scan

Start with a free process scan.

  • A 30-minute call with the engineer who would lead the work.
  • A review of the processes that cost you the most time and money.
  • A written summary of what to automate first and the likely cost range.

The scan chooses one process to assess, and within 2 business days you receive a recommendation, including when a simpler route is the better fit.

€0

30 minutes · written takeaway within 2 business days

Book a free process scan (30 min)

Times are shown in your own time zone. We work with clients across time zones.

Describe the process in the form