Capability Layering and Permission Isolation for a Unified Foundation Model

    A unified foundation model can reduce the cost of training, maintenance, and cross-channel consistency, but shared intelligence does not imply shared permissions. This article presents an architecture for separating the capability plane from the permission plane, using task-based access control, tool gating, sandbox execution, credential isolation, auditing, and policy-as-code practices to expose advanced capabilities without losing control over high-risk actions.

    1. Background and Design Objectives

    A unified foundation model can significantly reduce the cost of training, maintenance, and capability consistency across multiple entry points. However, using the same model does not mean granting every user or channel the same permissions.

    General-purpose coding, knowledge work, and task-oriented agents usually require a high degree of interaction freedom. By contrast, specialized scenarios such as cybersecurity and life sciences research may involve sensitive data, complex toolchains, and actions that can affect external systems. If every capability is exposed to every entry point, the risk can expand from inappropriate responses to tool abuse, data leakage, privilege escalation, and destructive execution.

    The right architectural goal is therefore not to maintain separate models for every scenario. Instead, organizations should layer capabilities on top of a unified foundation model while physically separating model intelligence from operational permissions.

    The model should handle understanding, planning, and the generation of structured action intent. The permission layer should handle identity and scenario validation, tool authorization, execution isolation, approvals, and auditing. Model output should never contain high-privilege credentials, and executors should accept only action requests validated by a policy engine.

    This approach preserves consistent model capabilities while restricting high-risk functions to boundaries that are verifiable, auditable, and reversible.

    2. Layered Architecture: Capability Plane and Permission Plane

    A layered design should clearly distinguish between two planes:

    • Capability plane: Reasoning, coding assistance, knowledge organization, task planning, and the generation of tool-calling intent.
    • Permission plane: Available tools, data-domain scope, execution environments, network egress policies, approval rules, and audit channels.

    The two planes should communicate through a structured contract rather than allowing the model to decide whether it can perform a high-privilege operation.

    At the entry-point level, general-purpose and specialized capabilities can be deployed separately. A general-purpose entry point may support everyday coding, knowledge work, and common task-oriented agents, with low- and medium-risk tools enabled by default. A specialized entry point may serve users who have passed scenario-specific validation and require deeper tool access or domain workflows. It should apply stricter qualification checks, task allowlists, and dual review where necessary.

    This “physical separation” should be reflected in credential domains, service boundaries, logging channels, and approval workflows—not merely in hidden interface buttons.

    Role definitions should be designed at the same time:

    • General developers use a restricted tool set.
    • Domain-validated users call specialized tools within approved task templates.
    • Reviewers approve high-risk actions.
    • Platform administrators maintain policies, the tool registry, and audit rules.

    Task-level authorization is more precise than user-level authorization alone because the risk associated with the same user can vary across different tasks.

    3. Task Classification and Admission Control

    Admission control should be based on the task, not only on the user account. A practical classification model can consider four dimensions:

    1. Data sensitivity
    2. Potential destructiveness of the operation
    3. Scope of external impact
    4. Reversibility

    General coding and knowledge work typically rely on read-only retrieval, code generation, test execution, and restricted file operations. Specialized scenarios may require deeper data access, complex computing environments, or actions that affect external systems, and therefore require additional validation.

    For high-risk scenarios such as cybersecurity and life sciences research, a combined control model is recommended:

    • Scenario validation
    • Task templates
    • Time-limited access windows
    • Secondary review

    Passing qualification and purpose validation should not automatically grant access to every tool. Instead, users should receive a short-lived, minimal tool set within a specific task template.

    High-risk write operations and actions with external impact should enter an approval queue. Approval records should include the action intent, target scope, parameter summary, and expected result. Once approved, the system should issue a short-lived, restricted credential and revoke it when the task ends.

    4. Tool-Calling Depth and Action Gating

    Tool calls are a key mechanism for releasing model capabilities, but they are also a major channel for risk amplification. A tool registry should define the following attributes for every tool:

    • Capability category
    • Risk level
    • Parameter constraints
    • Whether the tool performs write operations
    • Whether network access is allowed
    • Maximum call depth

    Before every action, the policy engine should validate the task type, tool allowlist, call depth, parameter range, and approval status. The model must not be able to escalate its own privileges or bypass a tool allowlist through multi-step planning.

    An illustrative gating flow is shown below:

    1. def authorize(task, action, context):
    2. if not task.verified and action.risk >= MEDIUM:
    3. return Deny("Scenario validation required")
    4. if action.tool not in task.allowed_tools:
    5. return Deny("Tool is not on the allowlist")
    6. if action.depth > task.max_depth:
    7. return Deny("Call depth exceeded")
    8. if action.mutates and not context.approval_id:
    9. return RequireApproval("Write operation requires approval")
    10. if action.network and not context.egress_allowlist.contains(action.target):
    11. return Deny("Egress target is not on the allowlist")
    12. return Allow(scope=short_lived_scope(task, action))

    Gating should follow several principles:

    • Prefer read-only operations.
    • Require approval for write operations.
    • Require secondary confirmation for dangerous actions.
    • Minimize external impact.

    For task-oriented agents, the system should also limit loop counts, total tool-call depth, and per-task resource quotas. These controls help prevent unlimited planning or chained calls from causing resource exhaustion or privilege-abuse attempts.

    5. Sandbox Execution and Credential Isolation

    Execution environments should use temporary sandboxes created for individual tasks. File systems should be read-only by default or mount only the minimum task-specific directories. Network access should be denied by default, with egress allowlists configured only when necessary. Resource quotas should also be enforced.

    Data used in specialized scenarios should be de-identified and minimized before loading. Execution results should pass through output sanitization before being returned to the model or the user. Credentials must not be placed in the model context. Instead, the executor should inject short-lived, restricted credentials only after authorization succeeds, while the model outputs structured action intent בלבד.

    In general cloud environments such as Baidu AI Cloud, container platforms, logging services, monitoring and alerting systems, and secret-management services can provide the infrastructure for sandboxing, auditing, and credential isolation. The key requirement is not a particular infrastructure form, but the ability to make execution boundaries, network boundaries, and credential boundaries configurable, verifiable, and revocable through policy.

    6. Auditing, Observability, and Red-Team Evaluation

    Auditing should cover:

    • Action intent
    • Authorization decisions
    • Tool parameter summaries
    • Execution results
    • Data access records

    Logs should be tamper-resistant or, at minimum, fully traceable. Useful observability metrics include authorization denial rates, approval latency, the number of privilege-escalation attempts, tool-call depth distributions, anomalous outbound connections, and unusual sandbox resource consumption.

    For high-risk scenarios, retain the complete approval chain and support replay capabilities. This makes incident investigation and responsibility attribution more effective.

    Before release, conduct red-team evaluations covering:

    • Prompt injection
    • Tool abuse
    • Data exfiltration
    • Privilege escalation
    • Multi-step bypass attempts

    After launch, use phased rollout and versioned policies. Monitor both false denials and false approvals, creating a continuous loop of evaluation, phased release, monitoring, review, and policy tuning.

    7. Policy as Code and the Operational Feedback Loop

    Permission policies should be versioned, testable, and reviewable, and should be managed using a policy-as-code approach. Every policy change should undergo regression testing with representative task samples to ensure that it does not unintentionally expand access to high-risk tools.

    The incident response process should include:

    • Stopping the task
    • Revoking credentials
    • Destroying the sandbox
    • Preserving logs
    • Correcting the relevant policy

    For developers, the main recommendations are:

    • Apply least privilege by default.
    • Deploy general-purpose and specialized entry points separately.
    • Use structured contracts to transmit action intent.
    • Do not delegate permission decisions to the model.
    • Define tool allowlists, depth limits, and approval rules for each task template.
    • Treat auditing and monitoring as mandatory controls rather than optional additions.

    A unified foundation model can maintain consistent capabilities, while layered exposure and permission isolation control misuse risk. This combination makes it possible to capture the value of advanced models without compromising operational security boundaries.