File size: 1,154 Bytes
5fc8c9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# okto_version: "1.2"
PROJECT "SecurityFullExample"
DESCRIPTION "Demonstrates complete SECURITY block configuration"

ENV {

  accelerator: "gpu"

  min_memory: "8GB"

  precision: "fp16"
}

DATASET {

  train: "examples/datasets/demo_train.jsonl"

  format: "jsonl"

  type: "chat"
}

MODEL {

  name: "secure-model"

  base: "oktoseek/base-mini"

  device: "cuda"
}

TRAIN {

  epochs: 5

  batch_size: 32

  device: "cuda"
}

SECURITY {
  input_validation {

    max_length: 1000

    disallow_patterns: [
      "<script>",
      "DROP TABLE",
      "DELETE FROM",
      "rm -rf",
      "sudo",
      "passwd",
      "chmod 777",
      "eval(",
      "exec("
    ]
  }
  
  output_validation {

    prevent_data_leak: true

    mask_personal_info: true
  }
  
  rate_limit {

    max_requests_per_minute: 120
  }
  
  encryption {

    algorithm: "AES-256"
  }
}

GUARD {
  prevent {
    toxicity
    bias
    data_leak
    unsafe_code
  }

  
  detect_using: ["classifier", "regex", "rule_engine"]
  
  on_violation {
    ALERT
  }
}

EXPORT {

  format: ["okm", "onnx"]

  path: "export/"
}