Description
The secrets field is used in the workflow compiler but is NOT defined in the schema, allowing undocumented and unvalidated usage. This was identified during schema consistency analysis (Discussion #13673).
Current Status:
- ✅ Used in compiler:
pkg/workflow/compiler_jobs.go:387 - configMap["secrets"]
- ✅ Has struct field:
pkg/workflow/frontmatter_types.go:493 - fc.Secrets
- ❌ NOT in schema:
pkg/parser/schemas/main_workflow_schema.json
- ❌ NOT documented
Impact
HIGH - Workflows can use undocumented/unvalidated secrets field, leading to:
- No type checking
- No validation
- Confusing for users (not in docs)
- Potential security implications
Suggested Changes
1. Add Schema Definition (30 minutes)
Add to pkg/parser/schemas/main_workflow_schema.json:
"secrets": {
"type": "object",
"description": "Secret values passed to workflow execution. Keys are secret names, values can be strings or objects with 'value' and 'description' properties.",
"additionalProperties": true,
"examples": [
{
"API_TOKEN": "value from secrets context",
"DATABASE_URL": {
"value": "${{ secrets.DB_URL }}",
"description": "Production database connection string"
}
}
]
}
2. Add Documentation (30 minutes)
Update docs/src/content/docs/reference/frontmatter.md with:
- Description of
secrets field
- Usage examples
- Security best practices
- How secrets are passed to agent execution
3. Add Test Cases (1 hour)
// In pkg/parser/ tests
func TestSecretsFieldValidation(t *testing.T) {
tests := []struct {
name string
secrets map[string]any
shouldErr bool
}{
{
name: "valid string secret",
secrets: map[string]any{"API_KEY": "test"},
},
{
name: "valid object secret",
secrets: map[string]any{
"DB": map[string]any{
"value": "connection-string",
"description": "Database",
},
},
},
{
name: "invalid type",
secrets: map[string]any{"KEY": []int{1, 2, 3}},
shouldErr: true,
},
}
// ... test implementation
}
Files Affected
pkg/parser/schemas/main_workflow_schema.json (schema definition)
docs/src/content/docs/reference/frontmatter.md (documentation)
pkg/parser/*_test.go (validation tests)
pkg/workflow/compiler_jobs.go (existing usage)
pkg/workflow/frontmatter_types.go (existing struct)
Success Criteria
Source
Extracted from Schema Consistency Analysis discussion #13673
Priority: High - Missing validation for security-sensitive field
AI generated by Discussion Task Miner - Code Quality Improvement Agent
Description
The
secretsfield is used in the workflow compiler but is NOT defined in the schema, allowing undocumented and unvalidated usage. This was identified during schema consistency analysis (Discussion #13673).Current Status:
pkg/workflow/compiler_jobs.go:387-configMap["secrets"]pkg/workflow/frontmatter_types.go:493-fc.Secretspkg/parser/schemas/main_workflow_schema.jsonImpact
HIGH - Workflows can use undocumented/unvalidated
secretsfield, leading to:Suggested Changes
1. Add Schema Definition (30 minutes)
Add to
pkg/parser/schemas/main_workflow_schema.json:2. Add Documentation (30 minutes)
Update
docs/src/content/docs/reference/frontmatter.mdwith:secretsfield3. Add Test Cases (1 hour)
Files Affected
pkg/parser/schemas/main_workflow_schema.json(schema definition)docs/src/content/docs/reference/frontmatter.md(documentation)pkg/parser/*_test.go(validation tests)pkg/workflow/compiler_jobs.go(existing usage)pkg/workflow/frontmatter_types.go(existing struct)Success Criteria
secretsfield added to schema with proper type definitionsecretscontinues to workSource
Extracted from Schema Consistency Analysis discussion #13673
Priority: High - Missing validation for security-sensitive field