From db681643540c7bfc6224fb5025efb5dc60166af6 Mon Sep 17 00:00:00 2001 From: Juan Date: Sun, 10 May 2026 10:51:31 +0200 Subject: [PATCH] =?UTF-8?q?feat(policies):=20a=C3=B1ade=20pol=C3=ADtica=20?= =?UTF-8?q?default=20v1=20con=20guardrails=20completos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- policies/default/index.yaml | 8 ++++ policies/default/versions/v1.yaml | 61 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 policies/default/index.yaml create mode 100644 policies/default/versions/v1.yaml diff --git a/policies/default/index.yaml b/policies/default/index.yaml new file mode 100644 index 0000000..55e2e25 --- /dev/null +++ b/policies/default/index.yaml @@ -0,0 +1,8 @@ +name: default +versions: + - id: v1 + hash: pending + author: Juan + message: Política base inicial con PII, injection, schema y reglas telco. + created_at: 2026-04-01T10:00:00Z +active_version: v1 diff --git a/policies/default/versions/v1.yaml b/policies/default/versions/v1.yaml new file mode 100644 index 0000000..b950af6 --- /dev/null +++ b/policies/default/versions/v1.yaml @@ -0,0 +1,61 @@ +name: default +version: v1 +description: Política base aplicada a agentes de operación de plataforma de voz. +input_validators: + - type: detect_pii + config: + entities: [PERSON, EMAIL_ADDRESS, PHONE_NUMBER, ES_NIF, IP_ADDRESS, IBAN_CODE] + severity_on_match: block + - type: prompt_injection + config: + severity_on_match: block + - type: toxic_language + config: + threshold: 0.7 + severity_on_match: warning + - type: forbidden_topics + config: + topics: ["instrucciones de explotación", "credenciales", "código malicioso"] + severity_on_match: block + +output_validators: + - type: schema_match + config: + severity_on_mismatch: block + schema: + type: object + required: [severity, root_cause_hypothesis, proposed_actions] + properties: + severity: + type: string + enum: [low, medium, high, critical] + root_cause_hypothesis: + type: string + proposed_actions: + type: array + items: + type: object + required: [id, action, target, risk_score, rollback_plan, requires_approval] + properties: + id: {type: string} + action: {type: string} + target: {type: string} + risk_score: {type: integer, minimum: 1, maximum: 5} + rollback_plan: {type: string} + requires_approval: {type: boolean} + - type: pii_leakage + config: + entities: [EMAIL_ADDRESS, PHONE_NUMBER, ES_NIF, IP_ADDRESS] + severity_on_match: block + - type: forbidden_action_keywords + config: + keywords: ["DROP TABLE", "rm -rf", "shutdown -h now", "delete production", "format c:"] + severity_on_match: block + - type: telco_safety_rules + config: + rules: + - never_propose_action_targeting_production_without_rollback + - never_propose_mass_action_without_canary + severity_on_violation: block + +on_validator_error: fail_closed