You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: workflows/cve-fixer/.ambient/ambient.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"name": "CVE Fixer",
3
3
"description": "Automate remediation of CVE issues reported by ProdSec team in Jira by creating pull requests with dependency updates and patches",
4
4
"systemPrompt": "You are a CVE remediation assistant for the Ambient Code Platform. Your role is to help users remediate CVE issues that have been reported by the ProdSec team in Jira by automatically creating pull requests with fixes.\n\nKEY RESPONSIBILITIES:\n- Guide users through the CVE remediation workflow for Jira-tracked vulnerabilities\n- Execute slash commands to perform specific security tasks\n- Find CVE issues opened by ProdSec team in Jira\n- Implement secure fixes that resolve vulnerabilities without breaking functionality\n- Create pull requests with dependency updates, patches, and comprehensive test results\n\nWORKFLOW METHODOLOGY:\n1. FIND - Find CVEs already reported in Jira for a component\n2. FIX - Implement remediation strategies (dependency updates, patches, code changes, PR creation)\n\nAVAILABLE COMMANDS:\n/cve.find - Find CVEs reported in Jira for a specific component\n/cve.fix - Implement fixes for discovered CVEs and create pull requests\n\nOUTPUT LOCATIONS:\n- Create all Jira CVE findings in: artifacts/cve-fixer/find/\n- Create all fix implementations in: artifacts/cve-fixer/fixes/\n\nNote: Commands will guide you through required setup steps on first use. If the user's component is not in component-repository-mappings.json, direct them to the \"Team Onboarding\" section in README.md.",
5
-
"startupPrompt": "Greet the user and introduce yourself as a CVE remediation assistant. Explain that you help remediate CVE issues reported by ProdSec in Jira by creating pull requests. Mention the two commands: /cve.find to discover CVEs and /cve.fix to implement fixes. If this is their first time, point them to README.md Team Onboarding for setup. Suggest starting with /cve.find and ask what they'd like to work on.",
5
+
"startupPrompt": "Greet the user and introduce yourself as a CVE remediation assistant. Explain that you help remediate CVE issues reported by ProdSec in Jira by creating pull requests. Mention the three commands: /onboard to add a new component, /cve.find to discover CVEs, and /cve.fix to implement fixes. If this is their first time or their component is not yet onboarded, suggest starting with /onboard. Otherwise suggest /cve.find and ask what they'd like to work on.",
Secrets may be injected by the Ambient session, a secrets manager, or an MCP server — do NOT rely solely on bash env var checks. Instead, attempt a lightweight test API call and let the response determine whether credentials are available.
57
+
**ALWAYS check for a Jira MCP server first** before attempting any curl/env var approach.
58
+
59
+
**2.1: Check for Jira MCP server — follow these exact steps in order**
60
+
61
+
**Step A**: If `mcp__session__refresh_credentials` is in the deferred tools list, call it now.
62
+
This activates workspace integrations including Jira.
63
+
64
+
**Step B**: Immediately after (or if no refresh was needed), attempt to fetch the Jira
65
+
tool directly using `select:` syntax — do this regardless of whether you think it exists:
-**HTTP 401** → credentials missing or invalid. Note: `/rest/api/3/myself` returns 401 for all authentication failures — there is no separate 403 for this endpoint. Only now inform the user:
78
-
- Check if `JIRA_API_TOKEN` and `JIRA_EMAIL` are configured as Ambient session secrets
79
-
- If not, generate a token at https://id.atlassian.com/manage-profile/security/api-tokens and export:
80
-
81
-
```bash
82
-
export JIRA_API_TOKEN="your-token-here"
83
-
export JIRA_EMAIL="your-email@redhat.com"
84
-
```
85
-
- **HTTP 000 after retry** → persistent network issue — inform user and stop
86
-
87
-
**Do NOT pre-check env vars with `[ -z"$JIRA_API_TOKEN" ]` and stop.** The variables may be available to the API call even if not visible to the shell check (e.g. Ambient secrets injection).
110
+
-**HTTP 401** → credentials truly not available or expired. Only now stop and inform user:
111
+
configure `JIRA_API_TOKEN` and `JIRA_EMAIL` as Ambient workspace secrets or export them
112
+
-**HTTP 000 after retry** → network issue — inform user and stop
88
113
89
114
3.**Query Jira for CVE Issues**
90
115
91
-
a. Set up variables (AUTH already set from Step 2):
116
+
a. Set up variables:
92
117
93
118
```bash
94
119
COMPONENT_NAME="[from step 1]"
95
120
JIRA_BASE_URL="https://redhat.atlassian.net"
96
-
# AUTH already constructed in Step 2 — reuse it
121
+
# If using MCP (Step 2.1): pass JQL directly to MCP tool — no AUTH needed
122
+
# If using curl (Step 2.2): AUTH already constructed in Step 2 — reuse it
97
123
```
98
124
99
-
b. Construct JQL query and execute API call:
125
+
b. Construct JQL query and execute via MCP or curl:
100
126
101
127
```bash
102
128
# Normalize component name with case-insensitive lookup against mapping file
0 commit comments