AI Fix Prompts for .Agents

Copy any prompt below into Claude, ChatGPT, or your AI coding assistant to automatically fix the issue. Each prompt includes full context, code location, and step-by-step fix instructions.

12
Total Prompts
0
Critical (P0)
12
High (P1)
0
Medium (P2)
0
Low (P3)
Download All (Markdown) Download All (JSON) Feed these prompts to any AI coder: Claude Code, Cursor, Copilot, GPT, Ollama
HIGH ⚡ quick-fix #1

Remove hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL

security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: skills/tw/post.ts
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'qodot__.agents'.

**Issue**: Hard-coded sast found ([sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL)
**File**: skills/tw/post.ts
**Line**: 82
**Severity**: HIGH

**Current code around the issue:**
```
      77 |   return /^https?:\/\//i.test(s);
      78 | }
      79 | 
      80 | async function downloadImage(url: string): Promise<string> {
      81 |   console.log(`📥 Downloading image from URL...`);
>>>   82 |   const res = await fetch(url);
      83 |   if (!res.ok) throw new Error(`Image download failed (${res.status})`);
      84 | 
      85 |   const contentType = res.headers.get("content-type") || "";
      86 |   const extMap: Record<string, string> = {
      87 |     "image/jpeg": ".jpg", "image/png": ".png",
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('SAST_KEY')` (Python) or `process.env.SAST_KEY` (JS)
3. Add the variable name to a `.env.example` file with a placeholder value
4. Ensure `.env` is in `.gitignore`
5. If this credential was ever committed to git, it should be considered compromised and rotated

**Do NOT:**
- Move the secret to a config file that gets committed
- Use a default fallback value that is a real credential
- Leave the old credential in a comment
Repobility · open methodology · https://repobility.com/research/
HIGH ⚡ quick-fix #2

Remove hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL

security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: skills/tw/post.ts
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'qodot__.agents'.

**Issue**: Hard-coded sast found ([sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL)
**File**: skills/tw/post.ts
**Line**: 141
**Severity**: HIGH

**Current code around the issue:**
```
     136 |     const uploadUrl = "https://upload.twitter.com/1.1/media/upload.json";
     137 |     const base64Data = fs.readFileSync(imagePath, "base64");
     138 |     const authData = { url: uploadUrl, method: "POST", data: { media_data: base64Data } };
     139 |     const auth = oauth.toHeader(oauth.authorize(authData, token));
     140 | 
>>>  141 |     const res = await fetch(uploadUrl, {
     142 |       method: "POST",
     143 |       headers: { ...auth, "Content-Type": "application/x-www-form-urlencoded" },
     144 |       body: new URLSearchParams({ media_data: base64Data }),
     145 |     });
     146 |     if (!res.ok) throw new Error(`Media upload failed (${res.status}): ${await res.text()}`);
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('SAST_KEY')` (Python) or `process.env.SAST_KEY` (JS)
3. Add the variable name to a `.env.example` file with a placeholder value
4. Ensure `.env` is in `.gitignore`
5. If this credential was ever committed to git, it should be considered compromised and rotated

**Do NOT:**
- Move the secret to a config file that gets committed
- Use a default fallback value that is a real credential
- Leave the old credential in a comment
HIGH ⚡ quick-fix #3

Remove hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL

security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: skills/tw/post.ts
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'qodot__.agents'.

**Issue**: Hard-coded sast found ([sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL)
**File**: skills/tw/post.ts
**Line**: 160
**Severity**: HIGH

**Current code around the issue:**
```
     155 |   const auth = oauth.toHeader(oauth.authorize({ url: tweetUrl, method: "POST" }, token));
     156 | 
     157 |   const body: Record<string, unknown> = { text };
     158 |   if (mediaId) body.media = { media_ids: [mediaId] };
     159 | 
>>>  160 |   const res = await fetch(tweetUrl, {
     161 |     method: "POST",
     162 |     headers: { ...auth, "Content-Type": "application/json" },
     163 |     body: JSON.stringify(body),
     164 |   });
     165 |   if (!res.ok) throw new Error(`Tweet failed (${res.status}): ${await res.text()}`);
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('SAST_KEY')` (Python) or `process.env.SAST_KEY` (JS)
3. Add the variable name to a `.env.example` file with a placeholder value
4. Ensure `.env` is in `.gitignore`
5. If this credential was ever committed to git, it should be considered compromised and rotated

**Do NOT:**
- Move the secret to a config file that gets committed
- Use a default fallback value that is a real credential
- Leave the old credential in a comment
HIGH ⚡ quick-fix #4

Remove hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL

security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: skills/tw/post.ts
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'qodot__.agents'.

**Issue**: Hard-coded sast found ([sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL)
**File**: skills/tw/post.ts
**Line**: 191
**Severity**: HIGH

**Current code around the issue:**
```
     186 |     text,
     187 |     media_type: publicImageUrl ? "IMAGE" : "TEXT",
     188 |   };
     189 |   if (publicImageUrl) containerParams.image_url = publicImageUrl;
     190 | 
>>>  191 |   const cRes = await fetch(`${base}/${userId}/threads`, {
     192 |     method: "POST",
     193 |     headers: { "Content-Type": "application/x-www-form-urlencoded" },
     194 |     body: new URLSearchParams(containerParams),
     195 |   });
     196 |   if (!cRes.ok) throw new Error(`Container failed (${cRes.status}): ${await cRes.text()}`);
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('SAST_KEY')` (Python) or `process.env.SAST_KEY` (JS)
3. Add the variable name to a `.env.example` file with a placeholder value
4. Ensure `.env` is in `.gitignore`
5. If this credential was ever committed to git, it should be considered compromised and rotated

**Do NOT:**
- Move the secret to a config file that gets committed
- Use a default fallback value that is a real credential
- Leave the old credential in a comment
HIGH ⚡ quick-fix #5

Remove hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL

security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: skills/tw/post.ts
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'qodot__.agents'.

**Issue**: Hard-coded sast found ([sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL)
**File**: skills/tw/post.ts
**Line**: 204
**Severity**: HIGH

**Current code around the issue:**
```
     199 |   console.log(`  📦 Container: ${container.id}`);
     200 | 
     201 |   // 2. Poll status (max 30s)
     202 |   for (let i = 0; i < 15; i++) {
     203 |     await new Promise<void>((r) => setTimeout(r, 2000));
>>>  204 |     const sRes = await fetch(`${base}/${container.id}?fields=status,error_message&access_token=${accessToken}`);
     205 |     const status = (await sRes.json()) as { status: string; error_message?: string };
     206 | 
     207 |     if (status.status === "FINISHED") break;
     208 |     if (status.status === "ERROR") throw new Error(`Container error: ${status.error_message}`);
     209 |     if (i === 14) throw new Error("Container processing timed out");
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('SAST_KEY')` (Python) or `process.env.SAST_KEY` (JS)
3. Add the variable name to a `.env.example` file with a placeholder value
4. Ensure `.env` is in `.gitignore`
5. If this credential was ever committed to git, it should be considered compromised and rotated

**Do NOT:**
- Move the secret to a config file that gets committed
- Use a default fallback value that is a real credential
- Leave the old credential in a comment
HIGH ⚡ quick-fix #6

Remove hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL

security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: skills/tw/post.ts
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'qodot__.agents'.

**Issue**: Hard-coded sast found ([sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL)
**File**: skills/tw/post.ts
**Line**: 214
**Severity**: HIGH

**Current code around the issue:**
```
     209 |     if (i === 14) throw new Error("Container processing timed out");
     210 |     console.log(`  ⏳ ${status.status}...`);
     211 |   }
     212 | 
     213 |   // 3. Publish
>>>  214 |   const pRes = await fetch(`${base}/${userId}/threads_publish`, {
     215 |     method: "POST",
     216 |     headers: { "Content-Type": "application/x-www-form-urlencoded" },
     217 |     body: new URLSearchParams({ access_token: accessToken, creation_id: container.id }),
     218 |   });
     219 |   if (!pRes.ok) throw new Error(`Publish failed (${pRes.status}): ${await pRes.text()}`);
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('SAST_KEY')` (Python) or `process.env.SAST_KEY` (JS)
3. Add the variable name to a `.env.example` file with a placeholder value
4. Ensure `.env` is in `.gitignore`
5. If this credential was ever committed to git, it should be considered compromised and rotated

**Do NOT:**
- Move the secret to a config file that gets committed
- Use a default fallback value that is a real credential
- Leave the old credential in a comment
HIGH ⚡ quick-fix #7

Remove hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL

security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: skills/tw/post.ts
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'qodot__.agents'.

**Issue**: Hard-coded sast found ([sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL)
**File**: skills/tw/post.ts
**Line**: 226
**Severity**: HIGH

**Current code around the issue:**
```
     221 |   const result = (await pRes.json()) as { id: string };
     222 | 
     223 |   // 4. Get permalink
     224 |   let url = `https://www.threads.net/@${config.THREADS_USERNAME}`;
     225 |   try {
>>>  226 |     const pLink = await fetch(`${base}/${result.id}?fields=permalink&access_token=${accessToken}`);
     227 |     if (pLink.ok) {
     228 |       const pData = (await pLink.json()) as { permalink?: string };
     229 |       if (pData.permalink) url = pData.permalink;
     230 |     }
     231 |   } catch {
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('SAST_KEY')` (Python) or `process.env.SAST_KEY` (JS)
3. Add the variable name to a `.env.example` file with a placeholder value
4. Ensure `.env` is in `.gitignore`
5. If this credential was ever committed to git, it should be considered compromised and rotated

**Do NOT:**
- Move the secret to a config file that gets committed
- Use a default fallback value that is a real credential
- Leave the old credential in a comment
HIGH ⚒ significant #8

Address OWASP A02 compliance gap

security compliance owasp
Expected outcome: OWASP A02 compliance issues resolved
Files to modify: Will be determined by the AI
Prompt (copy this into your AI assistant)
Address OWASP A02 (Cryptographic Failures) compliance gap in 'qodot__.agents'.

**OWASP Category**: A02 -- Cryptographic Failures
**Fix guidance**: Remove hardcoded secrets, use strong encryption (AES-256-GCM), enforce TLS, never store passwords in plaintext (use bcrypt/argon2).

**Steps:**
1. Identify all code paths related to cryptographic failures
2. Apply the fixes described above
3. Add automated tests to verify the fix
4. Document any security assumptions in code comments
HIGH ⚒ significant #9

Address OWASP A06 compliance gap

security compliance owasp
Expected outcome: OWASP A06 compliance issues resolved
Files to modify: Will be determined by the AI
Prompt (copy this into your AI assistant)
Address OWASP A06 (Vulnerable Components) compliance gap in 'qodot__.agents'.

**OWASP Category**: A06 -- Vulnerable Components
**Fix guidance**: Update all dependencies to latest stable versions, remove unused dependencies, monitor for new CVEs.

**Steps:**
1. Identify all code paths related to vulnerable components
2. Apply the fixes described above
3. Add automated tests to verify the fix
4. Document any security assumptions in code comments
All rows above produced by Repobility · https://repobility.com
HIGH ⚙ moderate #10

Fix quality gate failures (3 conditions)

quality-gate quality
Expected outcome: All quality gate conditions pass
Files to modify: Will be determined by the AI
Prompt (copy this into your AI assistant)
Repository 'qodot__.agents' is failing the quality gate.

Failed conditions:
- overall_score: actual 0.0 >= 50 (FAILED)
- security_score: actual 0.0 >= 40 (FAILED)
- critical_vulnerabilities: actual 7.0 <= 0 (FAILED)

Fix each failing condition to make the repo pass the quality gate.
HIGH ⚒ significant #11

Resolve 10 open issues

issues bugs
Expected outcome: All listed issues resolved
Files to modify: skills/tw/post.ts, skills/tw/post.ts, skills/tw/post.ts
Prompt (copy this into your AI assistant)
Repository 'qodot__.agents' has 10 open issues:

- [CRITICAL] GHSA-8g7p-74h8-hg48: https-proxy-agent
- [CRITICAL] GHSA-h755-8qp9-cq85: protobufjs
- [CRITICAL] GHSA-5rq4-664w-9x2c: basic-ftp
- [CRITICAL] GHSA-8r6j-v8pm-fqw3: fsevents
- [CRITICAL] GHSA-29xr-v42j-r956: thenify
- [CRITICAL] GHSA-m7jm-9gc2-mpf2: fast-xml-parser
- [CRITICAL] GHSA-4c7m-wxvm-r7gc: netmask
- [HIGH] Hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL (skills/tw/post.ts)
- [HIGH] Hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL (skills/tw/post.ts)
- [HIGH] Hard-coded sast: [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL (skills/tw/post.ts)

Resolve each issue. For security issues, apply the appropriate fix. For quality issues, refactor the affected code.
HIGH ⚙ moderate #12

Fix 7 SAST/security code findings

sast security code-fix
Expected outcome: All SAST findings resolved
Files to modify: skills/tw/post.ts
Prompt (copy this into your AI assistant)
Static analysis found 7 security issues in 'qodot__.agents':

- [HIGH] [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL at skills/tw/post.ts:82
- [HIGH] [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL at skills/tw/post.ts:141
- [HIGH] [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL at skills/tw/post.ts:160
- [HIGH] [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL at skills/tw/post.ts:191
- [HIGH] [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL at skills/tw/post.ts:204
- [HIGH] [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL at skills/tw/post.ts:214
- [HIGH] [sast:aljefra/ssrf-http-client] SSRF via HTTP Client with Dynamic URL at skills/tw/post.ts:226

For each finding:
- SQL injection: use parameterized queries
- Command injection: use subprocess with list args, no shell=True
- Path traversal: validate and sanitize paths
- Insecure deserialization: use json instead of pickle
- IaC misconfigs: apply the suggested fix from the rule