Policy
Policies define guardrails for model deployments across your fleet. Set quality gates, auto-rollback thresholds, and deployment constraints at the org level.
Set a policy
- CLI
- Python
octomil team set-policy \
--auto-rollback \
--error-threshold 5% \
--latency-p95-max 500ms \
--min-rollout-duration 1h \
--require-eval
from octomil import OctomilClient
client = OctomilClient(api_key="edg_...")
client.policies.set(
auto_rollback=True,
error_threshold_percent=5,
latency_p95_max_ms=500,
min_rollout_duration="1h",
require_eval=True,
)
Available policies
Auto-rollback
Automatically revert a deployment when error metrics exceed thresholds:
| Setting | Description | Default |
|---|---|---|
--auto-rollback | Enable automatic rollback | Off |
--error-threshold | Max error rate before rollback triggers | 5% |
--latency-p95-max | Max p95 latency before rollback triggers | No limit |
--crash-threshold | Max crash rate before rollback triggers | 1% |
octomil team set-policy --auto-rollback --error-threshold 3% --crash-threshold 0.5%
When triggered, auto-rollback reverts all affected devices to the previous stable version and sends an alert. See Rollback for manual rollback procedures.
Quality gates
Require evaluation benchmarks to pass before a deployment can proceed:
octomil team set-policy --require-eval --min-accuracy 0.70 --max-quality-delta 0.10
| Setting | Description | Default |
|---|---|---|
--require-eval | Block deploys until eval passes | Off |
--min-accuracy | Minimum accuracy score required | None |
--max-quality-delta | Max allowed quality drop vs. baseline | None |
With quality gates enabled, octomil deploy runs the eval suite automatically and blocks the deployment if thresholds are not met.
Rollout constraints
Control how fast deployments can roll out:
octomil team set-policy --min-rollout-duration 2h --max-rollout-step 25%
| Setting | Description | Default |
|---|---|---|
--min-rollout-duration | Minimum time between rollout advances | None |
--max-rollout-step | Maximum percentage increase per advance | 100% |
--require-approval | Require manual approval at each step | Off |
Device constraints
Restrict which devices can receive deployments:
octomil team set-policy --min-os-version ios:16 android:10 --min-memory 4GB
| Setting | Description | Default |
|---|---|---|
--min-os-version | Minimum OS version per platform | None |
--min-memory | Minimum device RAM | None |
--allowed-groups | Only deploy to specified device groups | All groups |
View current policy
octomil team get-policy
Auto-rollback: enabled
Error threshold: 5%
Crash threshold: 1%
Latency p95 max: 500ms
Quality gates: enabled
Require eval: yes
Min accuracy: 0.70
Rollout constraints:
Min duration: 1h
Max step: 25%
Policy scope
Policies apply at the org level. All deployments in the org must satisfy the active policy. Override per-deployment with --skip-policy (requires admin role).
Related
- Rollback -- manual and automatic rollback
- Rollouts -- gradual deployment strategies
- Benchmarks -- evaluation before deployment