File size: 1,419 Bytes
57dcac8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
name: CodeGuardian
description: A code review environment that tests AI agents on detecting security issues, assessing risks, and suggesting fixes
version: 1.0.0

spaces:
  - name: code_review
    description: Code review and security analysis tasks
    type: gymnasium
    
tasks:
  - id: easy_off_by_one
    name: "Off-by-One Error"
    difficulty: easy
    description: "Detect off-by-one error in array summation"
    space: code_review
    
  - id: medium_sql_injection  
    name: "SQL Injection"
    difficulty: medium
    description: "Identify SQL injection vulnerability in user query"
    space: code_review
    
  - id: hard_async_race
    name: "Async Race Condition"
    difficulty: hard
    description: "Find missing await and race condition in async code"
    space: code_review

reward:
  type: continuous
  min: 0.0
  max: 1.0
  description: "Score based on correct issue detection, risk assessment, and fix suggestions"

environment:
  class: CodeGuardianEnv
  module: env.environment
  observation_space:
    type: dict
    fields:
      code: str
      intent: str
      constraints: list
      task_id: str
      difficulty: str
      step_index: int
  action_space:
    type: dict
    fields:
      action_type: str
      detected_issues: list
      risk_level: str
      suggested_fix: str

metadata:
  author: CodeGuardian Team
  tags: ["code-review", "security", "ai-testing"]
  license: MIT