Files
cleveragents-core/robot/safety_profile.robot
T
CoreRasurae 66b9a4279f
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 32s
CI / typecheck (pull_request) Successful in 35s
CI / unit_tests (pull_request) Successful in 1m55s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 2m50s
CI / coverage (pull_request) Successful in 4m13s
CI / benchmark-regression (pull_request) Successful in 23m10s
CI / lint (push) Successful in 12s
CI / quality (push) Successful in 15s
CI / build (push) Successful in 15s
CI / security (push) Successful in 29s
CI / typecheck (push) Successful in 32s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m10s
CI / docker (push) Successful in 38s
CI / integration_tests (push) Successful in 4m1s
CI / coverage (push) Successful in 3m58s
CI / benchmark-publish (push) Successful in 13m21s
feat(security): add safety profile model and enforcement stubs
Add SafetyProfile domain model with configurable safety constraints
(checkpoint, human approval, cost limits, retry limits, skill
categories, sandbox requirement).  Integrate into Action model with
from_config/as_cli_dict support, and persist via LifecycleActionModel
safety_profile_json column.

Include resolve_safety_profile() stub that raises NotImplementedError
for local mode, signalling that real enforcement is deferred.

Add comprehensive test coverage:
- 20 BDD scenarios in features/safety_profile.feature
- 6 Robot Framework smoke tests
- 5 ASV benchmark suites (11 timing functions)

Add docs/reference/safety_profile.md reference documentation.

ISSUES CLOSED: #332
2026-03-02 17:44:18 +00:00

46 lines
2.1 KiB
Plaintext

*** Settings ***
Documentation Smoke tests for SafetyProfile domain model
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER_SCRIPT} robot/helper_safety_profile.py
*** Test Cases ***
Load Default Safety Profile
[Documentation] Load the default safety profile and verify defaults
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} default cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} safety-default-ok
Load Safety Profile From Config
[Documentation] Load a safety profile from a config dict
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} from-config cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} safety-from-config-ok
Load Safety Profile From YAML
[Documentation] Load a safety profile from a YAML file
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} from-yaml cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} safety-from-yaml-ok
Safety Profile Serialization
[Documentation] Serialize safety profile to JSON and verify
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} serialize cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} safety-serialize-ok
Safety Profile Ref Creation
[Documentation] Create a SafetyProfileRef and verify
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} ref cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} safety-ref-ok
Safety Profile Summary
[Documentation] Print summary of safety profile capabilities
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} summary cwd=${WORKSPACE}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} summary-ok