Files
OpenShell/proto/inference.proto
John T. MyersandJohn Myers e373f7c056 feat(inference): add sandbox-system inference route for platform-level inference (#209)
* feat(inference): add sandbox-system inference route for platform-level inference

Add a separate system-level inference route that the sandbox supervisor
can use in-process for platform functions (e.g., embedded agent harness
for policy analysis), distinct from the user-facing inference.local
endpoint. The system route is accessed via an in-process API on the
supervisor, ensuring userland code in the sandbox netns cannot reach it.

- Extend proto with route_name fields on Set/Get inference messages
- Add ResolvedRoute.name field to the router for route segregation
- Server resolves both user and sandbox-system routes in bundles
- Sandbox partitions routes into user/system caches on refresh
- Expose InferenceContext::system_inference() in-process API
- CLI --sandbox flag targets the system route on set/get/update
- Integration tests using mock:// routes for the full in-process path

Closes #207

* refactor(cli): rename --sandbox flag to --system for inference commands

The --sandbox flag could be misread as targeting a user-level sandbox
operation. Rename to --system to clearly indicate it configures the
platform-level system inference route.

* style(cli): collapse short if-else per rustfmt 1.94

---------

Co-authored-by: John Myers <johntmyers@users.noreply.github.com>
2026-03-10 15:30:07 -07:00

102 lines
3.1 KiB
Protocol Buffer

// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
syntax = "proto3";
package navigator.inference.v1;
option java_multiple_files = true;
option java_package = "com.anthropic.navigator.inference.v1";
// Inference service provides cluster inference configuration and bundle delivery.
service Inference {
// Return the resolved inference route bundle for sandbox-local execution.
rpc GetInferenceBundle(GetInferenceBundleRequest)
returns (GetInferenceBundleResponse);
// Set cluster-level inference configuration.
//
// This controls how requests sent to `inference.local` are routed.
rpc SetClusterInference(SetClusterInferenceRequest)
returns (SetClusterInferenceResponse);
// Get cluster-level inference configuration.
rpc GetClusterInference(GetClusterInferenceRequest)
returns (GetClusterInferenceResponse);
}
// Persisted cluster inference configuration.
//
// Only `provider_name` and `model_id` are stored; endpoint, protocols,
// credentials, and auth style are resolved from the provider at bundle time.
message ClusterInferenceConfig {
// Provider record name backing this route.
string provider_name = 1;
// Model identifier to force on generation calls.
string model_id = 2;
}
// Storage envelope for the managed cluster inference route.
message InferenceRoute {
string id = 1;
ClusterInferenceConfig config = 2;
// Object name ("inference.local" for the user-facing route,
// "sandbox-system" for the sandbox system-level route).
string name = 3;
// Monotonic version incremented on every update.
uint64 version = 4;
}
message SetClusterInferenceRequest {
// Provider record name to use for credentials + endpoint mapping.
string provider_name = 1;
// Model identifier to force on generation calls.
string model_id = 2;
// Route name to target. Empty string defaults to "inference.local" (user-facing).
// Use "sandbox-system" for the sandbox system-level inference route.
string route_name = 3;
}
message SetClusterInferenceResponse {
string provider_name = 1;
string model_id = 2;
uint64 version = 3;
// Route name that was configured.
string route_name = 4;
}
message GetClusterInferenceRequest {
// Route name to query. Empty string defaults to "inference.local" (user-facing).
// Use "sandbox-system" for the sandbox system-level inference route.
string route_name = 1;
}
message GetClusterInferenceResponse {
string provider_name = 1;
string model_id = 2;
uint64 version = 3;
// Route name that was queried.
string route_name = 4;
}
message GetInferenceBundleRequest {}
// A single resolved route ready for sandbox-local execution.
message ResolvedRoute {
string name = 1;
string base_url = 2;
repeated string protocols = 3;
string api_key = 4;
string model_id = 5;
string provider_type = 6;
}
message GetInferenceBundleResponse {
repeated ResolvedRoute routes = 1;
// Opaque revision tag for cache freshness checks.
string revision = 2;
// Timestamp (epoch ms) when this bundle was generated.
int64 generated_at_ms = 3;
}