Dual-Entry Architecture for LLMs: Risk-Tiered Routing in Practice

    This article presents a practical dual-entry architecture for serving large language models, where a single pool of model capabilities is exposed through two semantically distinct entry points: an open entry for general users and a trusted entry for verified tasks. It explains the routing decision layer, the three-layer risk detection approach (deterministic rules, a lightweight classifier, and session-level context aggregation), the design of a conservative fallback baseline, access control and auditing for the trusted entry, and the observability and engineering practices needed to operate the system. Readers will learn how to turn capability exposure from a global on/off switch into a configurable policy matrix without sacrificing frontier capabilities.

    1. Background: The Capability–Risk Tension of a Single Entry

    General-purpose LLM services have long faced a structural tension: the stronger the capability, the larger the risk exposure. If only one entry point is offered, the provider must choose between fully unlocking capability and strictly restricting high-risk requests. The former creates compliance and safety pressure; the latter undermines the normal user experience and product competitiveness.

    The industry is converging on a more pragmatic approach: rather than reworking the underlying capability, split scenarios at the access layer. The same underlying model capabilities are exposed as two semantically different entries — a general entry for all users, and a trusted-task entry for callers who have passed identity and purpose verification. The general entry automatically falls back to a more conservative baseline model when high-risk intent is detected; the trusted entry opens up full capability under controlled conditions, backed by stronger auditing and traceability.

    This article abstracts that approach into an implementable engineering design, covering its architecture, decision logic, fallback strategy, and operational considerations.

    2. Overall Architecture: Two Entries + One Decision Layer

    1. ┌─────────────────────┐
    2. General user ───▶│ Open Entry │
    3. └──────────┬──────────┘
    4. │
    5. Trusted task ───▶┌──────────▼──────────┐
    6. │ Trusted Entry │
    7. └──────────┬──────────┘
    8. │
    9. ┌──────────▼──────────┐
    10. │ Risk Detection & │
    11. │ Routing Decision Layer│
    12. └───────┬──────┬──────┘
    13. low risk│ │ high risk
    14. ┌───────▼──┐ ┌─▼──────────┐
    15. │ Frontier │ │ Conservative│
    16. │ Model │ │ Baseline │
    17. └──────────┘ └────────────┘

    Three key points:

    1. An entry is a policy boundary, not a model boundary. Both entries share the same model pool; the differences lie in admission checks, risk-detection strength, fallback strategy, and audit granularity.
    2. The decision layer must be stateless and low-latency. Detection logic should run at the gateway as much as possible, avoiding an extra model call (which would double both latency and cost).
    3. Fallback is degradation, not rejection. A high-risk request should not simply return an error; it should switch to a capability-limited but more controllable baseline model and continue serving, preserving availability.

    3. Risk Detection: Rules, Classifiers, and Confidence Tiers

    Risk detection should not rely on a single mechanism. A three-layer stack is recommended:

    • Layer 1: Deterministic rules. Keywords, regex, file types, and code-snippet features (e.g., exploit chains, dangerous bioweapon procedures, bulk scraping and distillation patterns). A rule hit is high-confidence and can be judged directly.
    • Layer 2: Lightweight classifier. A small, low-latency discriminative model scores the request across multiple risk dimensions and outputs a probability per dimension.
    • Layer 3: Context aggregation. It is common for a single turn to be harmless while a multi-turn combination crosses the line, so risk scores should accumulate at the session level rather than looking only at the current message.

    The detection result should be a structured label rather than a single boolean:

    1. {
    2. "risk_level": "high",
    3. "categories": ["cyber_offense", "bio_hazard", "model_extraction"],
    4. "confidence": 0.91,
    5. "session_accumulated_score": 0.67,
    6. "route": "conservative"
    7. }

    The route is decided by the policy engine based on risk_level, entry type, and tenant tier. Keeping the decision logic decoupled from the model call makes it easy to iterate independently.

    4. Fallback Strategy: Designing the “Conservative Baseline”

    Fallback is not simply swapping one model name for another; it is a combination of capability constraints:

    Dimension Frontier Model Conservative Baseline
    Output in high-risk domains Full Refuse or high-level outline only
    Context length Long Tightened
    Tool/function calling Open Whitelisted
    Output post-processing Standard filtering Added secondary review
    Audit trail Sampled Full

    Three engineering cautions: first, fallback must be transparent to the user without exposing internal details, using a unified message such as “this request has been switched to restricted mode”; second, fallback should be cacheable, so requests with the same risk fingerprint hit a cached decision directly and reduce latency; third, the fallback rate must be observable — if a class of legitimate business is being misclassified and falling back at high volume, the rules or thresholds need adjustment.

    5. Admission and Auditing for the Trusted Entry

    The value of the trusted entry lies in “opening full capability under controlled conditions,” so admission design matters more than the capability itself:

    • Dual verification of identity and purpose: verify not only the caller’s identity but also register the specific use case and data boundaries.
    • Least privilege and quotas: allocate call quotas by task type, with automatic rate limiting on abnormal spikes.
    • Full auditing: write requests, detection results, fallback decisions, and output summaries uniformly into a logging service, preserving a traceable chain.
    • Periodic review: trusted status is not permanent; review periodically whether the purpose still holds.

    6. Engineering Implementation and Observability

    • Policy at the gateway layer: place routing decisions in the access gateway for zero intrusion into business code.
    • Separate configuration from code: manage risk thresholds and fallback mapping tables via a config center, supporting canary rollout and fast rollback.
    • Metrics: beyond standard latency and error rate, focus on high-risk detection rate, fallback rate, misclassification appeal rate, and trusted-entry call distribution.
    • Cost perspective: a lower share of frontier-model calls directly reduces per-request cost, so the fallback mechanism is also a cost-governance tool.
    • Elasticity and storage: persist session risk context using caches and object storage, use a message queue to smooth peaks in the asynchronous audit pipeline, and run the whole system on a container platform for canary releases by policy version.

    7. Common Pitfalls

    1. Treating fallback as refusal: availability comes first; degradation beats errors.
    2. Looking only at single-turn requests: ignoring session accumulation lets multi-turn splitting bypass detection.
    3. Hard-coding policy: thresholds written into code require a release to change, making iteration very slow.
    4. No misclassification feedback loop: without an appeal and reflow mechanism, rules only become more conservative and eventually harm legitimate business.
    5. Sampled auditing: once the trusted entry uses sampled auditing, after-the-fact traceability is lost.

    8. Summary

    Splitting entries by risk scenario essentially turns “capability exposure” from a global switch into a configurable policy matrix. It gives the provider controllability without sacrificing frontier capability: the open entry holds the line with rules, classifiers, and conservative fallback, while the trusted entry trades admission and auditing for a higher capability ceiling. The key to implementation lies not in model selection but in the accuracy of the decision layer, the reasonableness of the fallback strategy, and the completeness of the auditing and metrics system.