tf_types/generated/dangerous_actions.rs
1// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.
2
3#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]
4
5use serde::{Deserialize, Serialize};
6use super::*;
7
8/// Catalog entry for one dangerous action.
9#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
10pub struct CatalogEntry {
11 /// Dotted action name, e.g. file.delete.
12 pub name: ActionName,
13 /// Danger categories assigned to this action.
14 pub danger_tags: Vec<DangerTag>,
15 /// Risk class the catalog recommends.
16 pub default_risk: RiskClass,
17 /// Approval requirement the catalog recommends.
18 pub default_approval: ApprovalRequirement,
19 /// Whether this action is intrinsically reversible.
20 #[serde(skip_serializing_if = "Option::is_none", default)]
21 pub default_reversible: Option<bool>,
22 /// Tags that any contract using this action MUST also declare. Used by the deep validator.
23 #[serde(skip_serializing_if = "Option::is_none", default)]
24 pub mandatory_tags: Option<Vec<DangerTag>>,
25 /// Human-readable description of why this action is dangerous.
26 pub description: String,
27}
28
29/// Canonical catalog of action names with their danger tags and default enforcement. Consumed by the agent-contract deep validator and AI integration guide.
30#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
31pub struct DangerousActions {
32 /// Version of the dangerous-actions catalog schema itself.
33 pub dangerous_actions_version: DangerousActions_DangerousActionsVersion,
34 /// Stable catalog identifier, e.g. tf-dangerous-std.
35 pub catalog_id: String,
36 /// Human-readable description of this catalog.
37 #[serde(skip_serializing_if = "Option::is_none", default)]
38 pub description: Option<String>,
39 /// Known-dangerous action entries. Contracts should cross-reference this catalog when declaring danger_tags.
40 pub actions: Vec<CatalogEntry>,
41}
42
43/// Version of the dangerous-actions catalog schema itself.
44#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
45pub enum DangerousActions_DangerousActionsVersion {
46 #[serde(rename = "1")]
47 V1,
48}