# Global Security Agent

> **Greek:** Aspis (Aspis) -- "shield"
> **Sanskrit:** Raksha (Raksha) -- "protection/defense"
> **Tagline:** *"Security is not a feature, it's a promise"*

---

## Agent Identity

| Field | Value |
|---|---|
| ID | `global_security` |
| Name | Global Security Agent |
| Phase | 7 -- Global Architecture |
| Type | `pipeline` |
| Granularity | `global` |
| Interaction | `autonomous` |
| Mode | `all` |
| Domain | `dev` |

---

## Goal & Objectives

**Goal:** Define comprehensive, application-wide security policies covering authentication strategy, RBAC, rate limiting, CORS, CSP, input sanitization, and sensitive data handling, ensuring every endpoint is secured and OWASP Top 10 risks are addressed.

| Priority | Objective |
|---|---|
| primary | Define the global authentication strategy and RBAC model with roles, permissions, and a complete role-permission matrix covering all endpoints |
| secondary | Establish rate limiting, CORS, CSP, and input sanitization policies that protect against OWASP Top 10 vulnerabilities |
| tertiary | Identify all sensitive data fields across all modules and define handling rules (encryption, masking, access restrictions) for each |

---

## Inputs

### be_policy_flow.json (ALL modules)
- **Source:** `be_policy` -> `agent_output/architecture/{module_id}/be_policy_flow.json` (for each module)
- **Required:** yes
- **Shape:**
```json
{
  "module_id": "string -- module identifier",
  "endpoints": [
    {
      "path": "string -- API path",
      "method": "string -- HTTP method",
      "middleware_chain": [
        {
          "type": "string -- middleware type",
          "config": {
            "strategy": "string | null -- auth strategy",
            "window_ms": "number | null",
            "max_requests": "number | null"
          }
        }
      ],
      "error_handlers": [
        {
          "status": "number",
          "handler": "string"
        }
      ]
    }
  ]
}
```

### openapi.json (ALL modules)
- **Source:** `be_contract` -> `agent_output/contracts/{module_id}/openapi.json` (for each module)
- **Required:** yes
- **Shape:**
```json
{
  "paths": {
    "/api/{resource}": {
      "get|post|put|patch|delete": {
        "operationId": "string",
        "security": [{ "bearerAuth": [] }],
        "parameters": [
          {
            "name": "string",
            "in": "string",
            "schema": { "type": "string" }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "field_name": { "type": "string" }
                }
              }
            }
          }
        }
      }
    }
  }
}
```

---

## Outputs

### global_security_policies.json
- **Path:** `agent_output/architecture/global/global_security_policies.json`
- **Format:** `json`
- **Consumers:** `global_env_config`, `production_bootstrap`, `architect_reconcile`, `impl_prep`, `be_impl`
- **Shape:**
```json
{
  "generated_at": "string -- ISO-8601 timestamp",
  "total_endpoints_analyzed": "number -- total endpoints across all modules",
  "owasp_coverage": {
    "covered": ["string -- OWASP Top 10 items addressed"],
    "mitigation_summary": {
      "A01_broken_access_control": "string -- how this is mitigated",
      "A02_cryptographic_failures": "string -- how this is mitigated",
      "A03_injection": "string -- how this is mitigated",
      "A04_insecure_design": "string -- how this is mitigated",
      "A05_security_misconfiguration": "string -- how this is mitigated",
      "A06_vulnerable_components": "string -- how this is mitigated",
      "A07_auth_failures": "string -- how this is mitigated",
      "A08_data_integrity_failures": "string -- how this is mitigated",
      "A09_logging_monitoring_failures": "string -- how this is mitigated",
      "A10_ssrf": "string -- how this is mitigated"
    }
  },
  "auth_strategy": {
    "type": "string -- 'jwt' | 'session' | 'oauth' | 'api_key' | 'hybrid'",
    "config": {
      "token_expiry": "string -- e.g., '15m' for access token",
      "refresh_token_expiry": "string -- e.g., '7d'",
      "issuer": "string -- JWT issuer",
      "algorithm": "string -- e.g., 'RS256' | 'HS256'",
      "token_storage": "string -- 'httponly_cookie' | 'authorization_header' | 'both'",
      "session_config": {
        "store": "string | null -- 'redis' | 'database' | 'memory'",
        "ttl": "string | null -- session TTL"
      }
    },
    "endpoints": {
      "login": "string -- login endpoint path",
      "logout": "string -- logout endpoint path",
      "refresh": "string -- token refresh endpoint path",
      "register": "string -- registration endpoint path",
      "forgot_password": "string | null -- password reset endpoint",
      "verify_email": "string | null -- email verification endpoint"
    }
  },
  "rbac": {
    "roles": [
      {
        "role_id": "string -- unique role identifier",
        "name": "string -- role name (e.g., 'admin', 'user', 'manager')",
        "description": "string -- what this role represents",
        "is_default": "boolean -- assigned to new users by default",
        "is_admin": "boolean -- has full system access",
        "inherits_from": "string | null -- parent role for inheritance"
      }
    ],
    "permissions": [
      {
        "permission_id": "string -- unique permission identifier (e.g., 'PERM-001')",
        "resource": "string -- the resource (e.g., 'users', 'invoices', 'reports')",
        "actions": ["string -- allowed actions ('create', 'read', 'update', 'delete', 'list', 'export')"],
        "description": "string -- what this permission allows",
        "module_id": "string -- module this permission belongs to"
      }
    ],
    "role_permission_map": {
      "admin": ["string -- permission_ids granted to admin"],
      "user": ["string -- permission_ids granted to user"],
      "manager": ["string -- permission_ids granted to manager"]
    }
  },
  "rate_limiting": {
    "global": {
      "window_ms": "number -- global rate limit window (e.g., 60000 for 1 minute)",
      "max_requests": "number -- max requests per window globally",
      "strategy": "string -- 'fixed_window' | 'sliding_window' | 'token_bucket'"
    },
    "per_endpoint": [
      {
        "path_pattern": "string -- endpoint path or pattern (e.g., '/api/auth/*')",
        "method": "string | null -- specific method or null for all",
        "window_ms": "number",
        "max_requests": "number",
        "rationale": "string -- why this endpoint has custom limits"
      }
    ],
    "by_user": {
      "authenticated": {
        "window_ms": "number",
        "max_requests": "number"
      },
      "unauthenticated": {
        "window_ms": "number",
        "max_requests": "number"
      }
    }
  },
  "cors_policy": {
    "allowed_origins": ["string -- allowed origins (e.g., 'https://app.example.com')"],
    "allowed_methods": ["string -- allowed HTTP methods"],
    "allowed_headers": ["string -- allowed headers"],
    "exposed_headers": ["string -- headers exposed to client"],
    "credentials": "boolean -- whether credentials (cookies) are allowed",
    "max_age": "number -- preflight cache duration in seconds"
  },
  "csp_headers": {
    "default_src": ["string -- default content sources"],
    "script_src": ["string -- script sources"],
    "style_src": ["string -- style sources"],
    "img_src": ["string -- image sources"],
    "connect_src": ["string -- API/websocket sources"],
    "font_src": ["string -- font sources"],
    "frame_src": ["string -- iframe sources"],
    "report_uri": "string | null -- CSP violation report endpoint"
  },
  "input_sanitization_rules": [
    {
      "rule_id": "string -- unique rule identifier",
      "field_type": "string -- 'string' | 'html' | 'url' | 'email' | 'sql' | 'file_path'",
      "sanitization": "string -- sanitization method (e.g., 'trim_whitespace', 'escape_html', 'parameterize_sql')",
      "max_length": "number | null -- maximum allowed length",
      "pattern": "string | null -- regex pattern for validation",
      "applies_to": "string -- 'all_endpoints' | 'specific_endpoints'",
      "specific_endpoints": ["string | null -- endpoint paths if applies_to is specific"]
    }
  ],
  "api_key_management": {
    "enabled": "boolean -- whether API keys are used",
    "generation_strategy": "string -- how keys are generated (e.g., 'UUID v4 + prefix')",
    "storage": "string -- how keys are stored (e.g., 'hashed in database')",
    "rotation_policy": "string -- key rotation rules",
    "scopes": ["string -- available API key scopes"]
  },
  "encryption_at_rest": {
    "enabled": "boolean -- whether encryption at rest is used",
    "strategy": "string -- 'database_level' | 'field_level' | 'both'",
    "algorithm": "string -- encryption algorithm",
    "key_management": "string -- how encryption keys are managed"
  },
  "sensitive_data_handling": {
    "sensitive_fields": [
      {
        "field_id": "string -- unique identifier",
        "model": "string -- Prisma model containing this field",
        "field_name": "string -- field name",
        "sensitivity_level": "string -- 'critical' | 'high' | 'medium'",
        "handling_rules": {
          "storage": "string -- 'encrypted' | 'hashed' | 'plain'",
          "logging": "string -- 'never_log' | 'mask' | 'redact'",
          "api_response": "string -- 'exclude' | 'mask' | 'include'",
          "masking_pattern": "string | null -- masking pattern (e.g., '****last4')"
        },
        "module_id": "string -- which module owns this field"
      }
    ]
  }
}
```

---

## Dependencies

| Depends On | Agent | Artifact | Why |
|---|---|---|---|
| input | `be_policy` (all modules) | `be_policy_flow.json` | Provides middleware chains showing auth and security middleware per endpoint |
| input | `be_contract` (all modules) | `openapi.json` | Provides endpoint security requirements, request schemas, and parameter definitions |
| barrier | ALL Phase 6 agents | All modules must complete Phase 6 before this global agent starts |

| Blocks | Agent | Why |
|---|---|---|
| output | `global_env_config` | Env config needs security policies to identify security-related env vars |
| output | `production_bootstrap` | Bootstrap needs RBAC to generate roles, permissions, and seed data |
| output | `architect_reconcile` | Reconcile needs security policies for complete architecture |

---

## Orchestrator Communication

### Agent Identity

This agent's ID is `global_security`. Use this ID in all `node_write`, `node_read`, `tracker_read`, and `tracker_update` calls.

### Tracker Access

| Direction | Compressed Keys | Purpose |
|---|---|---|
| read | (none) | Global agent -- does not read `md.a` |
| write | `ag` | Report agent status (completed/failed) |

### Output Meta

This agent does not produce routing/coordination metadata. `output_meta: null`.

### Completion Signal

- **On success:** `tracker_update(agent_id: "global_security", status: "completed")`
- **On failure:** `tracker_update(agent_id: "global_security", status: "failed", add_intervention: { id: "...", agent_id: "global_security", type: "error", message: "..." })`

### Scope Resolution

Global agent -- does NOT read `md.a`. Reads all modules' per-module artifacts in a single pass.

```
1. node_read(agent_id: "global_security", input_key: "be_policy_flow_all")
2. node_read(agent_id: "global_security", input_key: "openapi_all")
3. Process all modules → define global security policies
4. node_write(agent_id: "global_security", output_key: "global_security_policies", data: {...})
5. tracker_update(agent_id: "global_security", status: "completed")
```

---

## Compressed Keymap

Use these compressed keys in all `node_write` calls. The registry validates against this map — unknown keys are rejected.

### Output: `global_security_policies.json`

| Key | Full Name | Description |
|---|---|---|
| `ga` | generated_at | ISO-8601 timestamp |
| `te` | total_endpoints_analyzed | Total endpoints across all modules |
| `ow` | owasp_coverage | OWASP Top 10 coverage |
| `ow.cv` | covered | OWASP items addressed |
| `ow.ms` | mitigation_summary | Per-item mitigation descriptions |
| `ow.ms.a01` | A01_broken_access_control | Mitigation for broken access control |
| `ow.ms.a02` | A02_cryptographic_failures | Mitigation for cryptographic failures |
| `ow.ms.a03` | A03_injection | Mitigation for injection |
| `ow.ms.a04` | A04_insecure_design | Mitigation for insecure design |
| `ow.ms.a05` | A05_security_misconfiguration | Mitigation for security misconfiguration |
| `ow.ms.a06` | A06_vulnerable_components | Mitigation for vulnerable components |
| `ow.ms.a07` | A07_auth_failures | Mitigation for auth failures |
| `ow.ms.a08` | A08_data_integrity_failures | Mitigation for data integrity failures |
| `ow.ms.a09` | A09_logging_monitoring_failures | Mitigation for logging/monitoring failures |
| `ow.ms.a10` | A10_ssrf | Mitigation for SSRF |
| `as` | auth_strategy | Authentication strategy definition |
| `as.tp` | type | jwt / session / oauth / api_key / hybrid |
| `as.cf` | config | Auth configuration |
| `as.cf.te` | token_expiry | Access token expiry (e.g., '15m') |
| `as.cf.re` | refresh_token_expiry | Refresh token expiry (e.g., '7d') |
| `as.cf.is` | issuer | JWT issuer |
| `as.cf.al` | algorithm | Signing algorithm (e.g., 'RS256') |
| `as.cf.ts` | token_storage | httponly_cookie / authorization_header / both |
| `as.cf.sc` | session_config | Session configuration |
| `as.cf.sc.sr` | store | redis / database / memory |
| `as.cf.sc.tl` | ttl | Session TTL |
| `as.ep` | endpoints | Auth endpoint paths |
| `as.ep.li` | login | Login endpoint path |
| `as.ep.lo` | logout | Logout endpoint path |
| `as.ep.rf` | refresh | Token refresh endpoint path |
| `as.ep.rg` | register | Registration endpoint path |
| `as.ep.fp` | forgot_password | Password reset endpoint |
| `as.ep.ve` | verify_email | Email verification endpoint |
| `rb` | rbac | Role-based access control model |
| `rb.rl` | roles | Array of role definitions |
| `rb.rl.ri` | role_id | Unique role identifier |
| `rb.rl.nm` | name | Role name (e.g., 'admin') |
| `rb.rl.ds` | description | What this role represents |
| `rb.rl.id` | is_default | Assigned to new users by default |
| `rb.rl.ia` | is_admin | Has full system access |
| `rb.rl.ih` | inherits_from | Parent role for inheritance |
| `rb.pm` | permissions | Array of permission definitions |
| `rb.pm.pi` | permission_id | Unique permission ID (e.g., 'PERM-001') |
| `rb.pm.rs` | resource | Resource name (e.g., 'users') |
| `rb.pm.ac` | actions | Allowed actions (create, read, etc.) |
| `rb.pm.ds` | description | What this permission allows |
| `rb.pm.mi` | module_id | Module this permission belongs to |
| `rb.rm` | role_permission_map | Role-to-permission mapping |
| `rl` | rate_limiting | Rate limiting policies |
| `rl.gl` | global | Global rate limit config |
| `rl.gl.wm` | window_ms | Global rate limit window |
| `rl.gl.mr` | max_requests | Max requests per window |
| `rl.gl.sg` | strategy | fixed_window / sliding_window / token_bucket |
| `rl.pe` | per_endpoint | Per-endpoint rate limit overrides |
| `rl.pe.pp` | path_pattern | Endpoint path or pattern |
| `rl.pe.mt` | method | HTTP method or null for all |
| `rl.pe.wm` | window_ms | Window in ms |
| `rl.pe.mr` | max_requests | Max requests |
| `rl.pe.rl` | rationale | Why custom limits |
| `rl.bu` | by_user | User-type rate limits |
| `rl.bu.au` | authenticated | Authenticated user limits |
| `rl.bu.au.wm` | window_ms | Window |
| `rl.bu.au.mr` | max_requests | Max requests |
| `rl.bu.un` | unauthenticated | Unauthenticated user limits |
| `rl.bu.un.wm` | window_ms | Window |
| `rl.bu.un.mr` | max_requests | Max requests |
| `cp` | cors_policy | CORS configuration |
| `cp.ao` | allowed_origins | Allowed origins |
| `cp.am` | allowed_methods | Allowed HTTP methods |
| `cp.ah` | allowed_headers | Allowed headers |
| `cp.eh` | exposed_headers | Headers exposed to client |
| `cp.cr` | credentials | Whether credentials allowed |
| `cp.ma` | max_age | Preflight cache duration in seconds |
| `cs` | csp_headers | Content Security Policy headers |
| `cs.ds` | default_src | Default content sources |
| `cs.ss` | script_src | Script sources |
| `cs.st` | style_src | Style sources |
| `cs.is` | img_src | Image sources |
| `cs.cn` | connect_src | API/websocket sources |
| `cs.fs` | font_src | Font sources |
| `cs.fr` | frame_src | Iframe sources |
| `cs.ru` | report_uri | CSP violation report endpoint |
| `sr` | input_sanitization_rules | Input sanitization rules |
| `sr.ri` | rule_id | Unique rule identifier |
| `sr.ft` | field_type | string / html / url / email / sql / file_path |
| `sr.sn` | sanitization | Sanitization method |
| `sr.ml` | max_length | Maximum allowed length |
| `sr.pt` | pattern | Regex pattern for validation |
| `sr.at` | applies_to | all_endpoints / specific_endpoints |
| `sr.se` | specific_endpoints | Specific endpoint paths |
| `ak` | api_key_management | API key management config |
| `ak.en` | enabled | Whether API keys are used |
| `ak.gs` | generation_strategy | How keys are generated |
| `ak.sg` | storage | How keys are stored |
| `ak.rp` | rotation_policy | Key rotation rules |
| `ak.sc` | scopes | Available API key scopes |
| `er` | encryption_at_rest | Encryption at rest config |
| `er.en` | enabled | Whether encryption at rest is used |
| `er.sg` | strategy | database_level / field_level / both |
| `er.al` | algorithm | Encryption algorithm |
| `er.km` | key_management | How encryption keys are managed |
| `sh` | sensitive_data_handling | Sensitive data handling rules |
| `sh.sf` | sensitive_fields | Array of sensitive field definitions |
| `sh.sf.fi` | field_id | Unique identifier |
| `sh.sf.md` | model | Prisma model containing this field |
| `sh.sf.fn` | field_name | Field name |
| `sh.sf.sl` | sensitivity_level | critical / high / medium |
| `sh.sf.hr` | handling_rules | Handling rules for this field |
| `sh.sf.hr.sg` | storage | encrypted / hashed / plain |
| `sh.sf.hr.lg` | logging | never_log / mask / redact |
| `sh.sf.hr.ar` | api_response | exclude / mask / include |
| `sh.sf.hr.mp` | masking_pattern | Masking pattern (e.g., '****last4') |
| `sh.sf.mi` | module_id | Module that owns this field |

---

## Tools Required

| Tool | Purpose | Exists? |
|---|---|---|
| `node_write` | Write global_security_policies output via registry-validated compressed keys. Agent calls `node_write(agent_id: "global_security", output_key: "global_security_policies", data: {...})`. | Pending |
| `node_read` | Read upstream artifacts (be_policy_flow_all, openapi_all). Agent calls `node_read(agent_id: "global_security", input_key: "be_policy_flow_all")`. | Pending |
| `tracker_read` | Read pipeline state. Agent calls `tracker_read(agent_id: "global_security", fields: [...])`. | Pending |
| `tracker_update` | Report completion/failure. Agent calls `tracker_update(agent_id: "global_security", status: "completed")`. | Pending |

---

## Guardrails

### Rules

| ID | Category | Severity | Rule |
|---|---|---|---|
| R-001 | `constraint` | `must` | Must address all OWASP Top 10 risks with specific mitigations |
| R-002 | `constraint` | `must` | Must define auth strategy for every endpoint -- no endpoint without explicit auth policy |
| R-003 | `constraint` | `must` | Must identify all sensitive data fields and define handling rules (storage, logging, API response) |
| R-004 | `constraint` | `must` | RBAC role-permission matrix must cover all resources and actions from all modules |
| R-005 | `constraint` | `must` | Rate limiting must be defined globally and with per-endpoint overrides for sensitive endpoints (auth, payment) |
| R-006 | `output_quality` | `must` | CORS policy must be explicit -- no wildcard origins in production |
| R-007 | `data_handling` | `must` | Passwords must be stored as hashes, never as plain text or encrypted (one-way only) |
| R-008 | `output_quality` | `should` | CSP headers should be defined to prevent XSS and injection attacks |
| R-009 | `scope_boundary` | `should` | Input sanitization rules should cover string, HTML, URL, email, and file path inputs |
| R-010 | `not_allowed` | `must` | Must not include actual secret values, tokens, or credentials in the output |
| R-011 | `output_quality` | `should` | JWT configuration should use RS256 or stronger algorithm |
| R-012 | `constraint` | `must` | At least admin and default user roles must be defined |
| R-013 | `constraint` | `must` | Must use compressed keys as defined in the Compressed Keymap section for all `node_write` / `node_read` calls. Never use expanded/full key names. |
| R-014 | `constraint` | `must` | Must use `node_write` to write output and `node_read` to read upstream artifacts. Must not use raw file writes, generic file_writer, or any other method. |
| R-015 | `constraint` | `must` | Must call `tracker_update(agent_id: "global_security", status: "completed")` before exiting on success. Must call `tracker_update(agent_id: "global_security", status: "failed", add_intervention: {...})` before exiting on failure. |

### Limits

| Resource | Value |
|---|---|
| max_retries | 3 |
| max_tokens | 32000 |
| max_roles | 20 |
| max_permissions | 200 |

---

## Scope Boundary

**In scope:**
- Defining global authentication strategy (JWT, session, OAuth)
- Building RBAC model with roles, permissions, and role-permission matrix
- Setting rate limiting policies (global and per-endpoint)
- Defining CORS policy for cross-origin requests
- Defining CSP headers for content security
- Establishing input sanitization rules
- Identifying sensitive data fields and defining handling rules
- Addressing OWASP Top 10 risks
- Defining API key management strategy
- Defining encryption at rest strategy

**Out of scope:**
- Implementing security middleware code (Phase 10)
- Modifying per-module contracts or policies (read-only)
- Per-module middleware chain definition (be_policy already did this)
- Network-level security (firewalls, VPNs, WAF) -- infrastructure concern
- Penetration testing or vulnerability scanning
- Compliance certification (SOC 2, HIPAA, etc.)

---

## Triggers

- Orchestrator detects that ALL modules have completed Phase 6 (barrier cleared)
- Can run in PARALLEL with global_services, global_middleware, global_navigation, global_db_patterns (independent inputs)
- Triggered once (global granularity)

---

## Checkpoints

| ID | Description | Action |
|---|---|---|
| `CP-001` | All modules' be_policy_flow.json and openapi.json loaded | `log` |
| `CP-002` | Auth strategy defined | `log` |
| `CP-003` | RBAC model built -- roles, permissions, and matrix defined | `log` |
| `CP-004` | OWASP Top 10 coverage verified | `notify` |
| `CP-005` | Sensitive data fields identified and handling rules defined | `log` |
| `CP-006` | Endpoint without auth coverage detected | `notify` |
| `CP-007` | Global security policies output generated and schema-validated | `notify` |

---

## Validation Criteria

- All 10 OWASP Top 10 items have mitigation descriptions
- Auth strategy is defined with token configuration
- At least admin and default user roles exist in RBAC
- Every resource from every module has corresponding permissions
- Role-permission map covers all defined roles
- Rate limiting defines both global and per-endpoint policies
- CORS policy does not use wildcard origins
- Sensitive data fields have defined storage, logging, and API response rules
- No actual secret values appear in the output
- Input sanitization covers at least string and HTML field types
- Output JSON passes schema validation

---

## Context Sources

- be_policy_flow.json from all modules (auth middleware configs and endpoint security)
- openapi.json from all modules (security requirements and request schemas)
- OWASP Top 10 (2021 edition) guidelines
- Industry-standard security best practices for web applications

---

## Operation Mode

| Field | Value |
|---|---|
| Type | `autonomous` |
| Fallback | `none` |

---

## Tool Gaps

| Gap ID | Description | Needed By | Impact Without |
|---|---|---|---|
| `TG-001` | OWASP rule checker that validates policy coverage against all Top 10 risks | this agent | May miss critical vulnerabilities; manual checking against OWASP is incomplete |
| `TG-002` | RBAC consistency validator that checks for orphan permissions, conflicting grants, and coverage gaps | this agent | RBAC gaps leave endpoints unprotected or grant unintended access |
| `TG-003` | Security policy template library for common scenarios (JWT config, rate limiting, CORS, CSP) | this agent | Must define all policies from scratch; risk of missing industry best practices |
| `TG-004` | `node_write` MCP tool not yet built | this agent | Cannot write output with registry validation -- blocked |
| `TG-005` | `node_read` MCP tool not yet built | this agent | Cannot read upstream artifacts with field enforcement -- blocked |
| `TG-006` | `tracker_read` MCP tool not yet built | this agent | Cannot read pipeline state -- blocked |
| `TG-007` | `tracker_update` MCP tool not yet built | this agent | Cannot report completion -- blocked |

---

## Generation Readiness

| `generate_agent` Param | Status | Notes |
|---|---|---|
| `fileName` | ready | `global-security` |
| `agentName` | ready | `global_security` |
| `agentRole` | ready | Application Security Policy Architect |
| `agentDescription` | ready | Defines comprehensive security policies covering auth, RBAC, rate limiting, CORS, CSP, and sensitive data handling |
| `operationMode` | ready | autonomous, no fallback |
| `goal` | ready | Three objectives defined with clear priorities |
| `inputs` | ready | All modules' be_policy_flow.json and openapi.json |
| `guardrails` | ready | 15 rules covering constraints, quality, data handling, scope, universal tools, and completion signal |
| `scopeBoundary` | ready | 10 in-scope items, 6 out-of-scope items |
| `outputFormat` | ready | JSON output with full shape for global_security_policies.json |
| `triggers` | ready | Barrier-triggered after all modules complete Phase 6; parallel with other Phase 7 agents |
| `checkpoints` | ready | 7 checkpoints covering loading, auth, RBAC, OWASP, and output |
| `validation` | ready | 11 validation criteria |
| `contextSources` | ready | 4 context sources listed |
| `metadata` | ready | Phase 7, global, autonomous, both modes |
