AI Fix Prompts for Workmuch

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.

11
Total Prompts
4
Critical (P0)
7
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
CRITICAL ⚡ quick-fix #1

Remove hard-coded api_key: Vault Token

security credentials api_key
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: workmuch/usageinfo_macos_native.py
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'jlisee__workmuch'.

**Issue**: Hard-coded api_key found (Vault Token)
**File**: workmuch/usageinfo_macos_native.py
**Line**: 123
**Severity**: CRITICAL

**Current code around the issue:**
```
     118 | 
     119 |     def get_focused_window_title(self, pid):
     120 |         if pid <= 0:
     121 |             return ""
     122 | 
>>>  123 |         app_element = self._app_services.AXUIElementCreateApplication(pid)
     124 |         if app_element is None:
     125 |             return ""
     126 | 
     127 |         error, focused_window = self._app_services.AXUIElementCopyAttributeValue(
     128 |             app_element,
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('API_KEY_KEY')` (Python) or `process.env.API_KEY_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
Same scanner, your repo: https://repobility.com — Repobility
CRITICAL ⚡ quick-fix #2

Remove hard-coded api_key: Vault Token

security credentials api_key
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: workmuch/usageinfo_macos_native.py
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'jlisee__workmuch'.

**Issue**: Hard-coded api_key found (Vault Token)
**File**: workmuch/usageinfo_macos_native.py
**Line**: 127
**Severity**: CRITICAL

**Current code around the issue:**
```
     122 | 
     123 |         app_element = self._app_services.AXUIElementCreateApplication(pid)
     124 |         if app_element is None:
     125 |             return ""
     126 | 
>>>  127 |         error, focused_window = self._app_services.AXUIElementCopyAttributeValue(
     128 |             app_element,
     129 |             self._app_services.kAXFocusedWindowAttribute,
     130 |             None,
     131 |         )
     132 |         if (
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('API_KEY_KEY')` (Python) or `process.env.API_KEY_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
CRITICAL ⚡ quick-fix #3

Remove hard-coded api_key: Vault Token

security credentials api_key
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: workmuch/usageinfo_macos_native.py
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'jlisee__workmuch'.

**Issue**: Hard-coded api_key found (Vault Token)
**File**: workmuch/usageinfo_macos_native.py
**Line**: 129
**Severity**: CRITICAL

**Current code around the issue:**
```
     124 |         if app_element is None:
     125 |             return ""
     126 | 
     127 |         error, focused_window = self._app_services.AXUIElementCopyAttributeValue(
     128 |             app_element,
>>>  129 |             self._app_services.kAXFocusedWindowAttribute,
     130 |             None,
     131 |         )
     132 |         if (
     133 |             error != self._app_services.kAXErrorSuccess
     134 |             or focused_window is None
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('API_KEY_KEY')` (Python) or `process.env.API_KEY_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
CRITICAL ⚡ quick-fix #4

Remove hard-coded api_key: Vault Token

security credentials api_key
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: workmuch/usageinfo_macos_native.py
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'jlisee__workmuch'.

**Issue**: Hard-coded api_key found (Vault Token)
**File**: workmuch/usageinfo_macos_native.py
**Line**: 138
**Severity**: CRITICAL

**Current code around the issue:**
```
     133 |             error != self._app_services.kAXErrorSuccess
     134 |             or focused_window is None
     135 |         ):
     136 |             return ""
     137 | 
>>>  138 |         title_error, title_value = self._app_services.AXUIElementCopyAttributeValue(
     139 |             focused_window,
     140 |             self._app_services.kAXTitleAttribute,
     141 |             None,
     142 |         )
     143 |         if title_error != self._app_services.kAXErrorSuccess or title_value is None:
```

**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('API_KEY_KEY')` (Python) or `process.env.API_KEY_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/taint-path-traversal] Path Traversal via Tainted Data

security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify: workmuch/pytime.py
Prompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'jlisee__workmuch'.

**Issue**: Hard-coded sast found ([sast:aljefra/taint-path-traversal] Path Traversal via Tainted Data)
**File**: workmuch/pytime.py
**Line**: 72
**Severity**: HIGH

**Current code around the issue:**
```
      67 | 
      68 |         timeutil.sleep(sleepTime)
      69 | 
      70 | def getLogDir():
      71 |     # Retrieve the logging directory and make sure it exists
>>>   72 |     logDir = os.path.join(os.environ['HOME'], '.workmuch')
      73 |     #logDir = '/home/jlisee/.workmuch'
      74 | 
      75 |     # Ensure the directory exists
      76 |     if not os.path.exists(logDir):
      77 |         os.mkdir(logDir)
```

**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 #6

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 'jlisee__workmuch'.

**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 #7

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 'jlisee__workmuch'.

**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
HIGH ⚒ significant #8

Address OWASP A07 compliance gap

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

**OWASP Category**: A07 -- Auth Failures
**Fix guidance**: Implement proper session management, use MFA where possible, enforce strong passwords, protect against brute force.

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

Fix quality gate failures (4 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 'jlisee__workmuch' is failing the quality gate.

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

Fix each failing condition to make the repo pass the quality gate.
Repobility · code-quality intelligence · https://repobility.com
HIGH ⚒ significant #10

Resolve 10 open issues

issues bugs
Expected outcome: All listed issues resolved
Files to modify: workmuch/usageinfo_macos_native.py, workmuch/usageinfo_macos_native.py, workmuch/usageinfo_macos_native.py, workmuch/usageinfo_macos_native.py, workmuch/pytime.py
Prompt (copy this into your AI assistant)
Repository 'jlisee__workmuch' has 10 open issues:

- [CRITICAL] GHSA-fff8-4w9p-7v76: pygments
- [CRITICAL] Hard-coded api_key: Vault Token (workmuch/usageinfo_macos_native.py)
- [CRITICAL] Hard-coded api_key: Vault Token (workmuch/usageinfo_macos_native.py)
- [CRITICAL] Hard-coded api_key: Vault Token (workmuch/usageinfo_macos_native.py)
- [CRITICAL] Hard-coded api_key: Vault Token (workmuch/usageinfo_macos_native.py)
- [HIGH] GHSA-pq64-v7f5-gqh8: pygments
- [HIGH] GHSA-9w8r-397f-prfh: pygments
- [HIGH] Hard-coded sast: [sast:aljefra/taint-path-traversal] Path Traversal via Tainted Data (workmuch/pytime.py)
- [MEDIUM] PYSEC-2023-117: pygments
- [LOW] GHSA-5239-wwwm-4pmq: pygments

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

Fix 1 SAST/security code findings

sast security code-fix
Expected outcome: All SAST findings resolved
Files to modify: workmuch/pytime.py
Prompt (copy this into your AI assistant)
Static analysis found 1 security issues in 'jlisee__workmuch':

- [HIGH] [sast:aljefra/taint-path-traversal] Path Traversal via Tainted Data at workmuch/pytime.py:72

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