#363

vercel-cli-with-tokens: token checks print the token into the agent transcript

OpenJacobTRNDopened 3d ago

At 1a2c79d, several steps in skills/vercel-cli-with-tokens/SKILL.md print the Vercel token value into the agent's output, or ask the user to paste it into chat. Agent transcripts are often logged, shared or synced, so the token ends up stored outside the user's shell.

  • Line 20, printenv VERCEL_TOKEN, prints the token to check whether it is set.
  • Line 28, grep '^VERCEL_TOKEN=' .env, prints the full line, value included.
  • Lines 42 and 78 (grep -i 'vercel' .env) and line 317 (printenv | grep -i vercel and grep -i vercel .env) print every matching variable with its value, which includes any token.
  • Line 53 says: "ask the user to provide one". In an agent session the user then pastes the token into the chat.

The skill already keeps the token out of --token arguments (lines 55-67). These checks are the remaining way it leaks.

Suggested changes:

  1. Test for presence without printing the value, for example [ -n "$VERCEL_TOKEN" ] && echo "VERCEL_TOKEN is set".
  2. For .env files, list variable names only, for example grep -i vercel .env | cut -d= -f1. Export the value without echoing it, as line 34 already does.
  3. Replace line 53 with an instruction to the user: set VERCEL_TOKEN in their own shell or .env file, and do not paste it into the conversation.

Activity

1
JacobTRND3d ago

Proposed patch for this issue. It is the complete change and can be applied with git apply.

--- a/skills/vercel-cli-with-tokens/SKILL.md	2026-11-09 01:22:09
+++ b/skills/vercel-cli-with-tokens/SKILL.md	2026-11-09 01:22:09
@@ -17,15 +17,15 @@
 ### A) `VERCEL_TOKEN` is already set in the environment
 
 ```bash
-printenv VERCEL_TOKEN
+[ -n "$VERCEL_TOKEN" ] && echo "VERCEL_TOKEN is set" || echo "VERCEL_TOKEN is not set"
 ```
 
-If this returns a value, you're ready. Skip to Step 2.
+If it is set, you're ready. Skip to Step 2. Never print the token value itself.
 
 ### B) Token is in a `.env` file under `VERCEL_TOKEN`
 
 ```bash
-grep '^VERCEL_TOKEN=' .env 2>/dev/null
+grep -q '^VERCEL_TOKEN=' .env 2>/dev/null && echo "VERCEL_TOKEN found in .env"
 ```
 
 If found, export it:
@@ -39,10 +39,10 @@
 Look for any variable that looks like a Vercel token (Vercel tokens typically start with `vca_`):
 
 ```bash
-grep -i 'vercel' .env 2>/dev/null
+grep -i 'vercel' .env 2>/dev/null | cut -d= -f1
 ```
 
-Inspect the output to identify which variable holds the token, then export it as `VERCEL_TOKEN`:
+This lists variable names only. Identify which variable holds the token, then export it as `VERCEL_TOKEN` without echoing it:
 
 ```bash
 export VERCEL_TOKEN=$(grep '^<VARIABLE_NAME>=' .env | cut -d= -f2-)
@@ -50,7 +50,7 @@
 
 ### D) No token found — ask the user
 
-If none of the above yield a token, ask the user to provide one. They can create a Vercel access token at vercel.com/account/tokens.
+If none of the above yield a token, ask the user to create one at vercel.com/account/tokens and set it as `VERCEL_TOKEN` in their shell or `.env` file themselves. Do not ask them to paste the token into the conversation.
 
 ---
 
@@ -74,8 +74,8 @@
 printenv VERCEL_PROJECT_ID
 printenv VERCEL_ORG_ID
 
-# Or check .env
-grep -i 'vercel' .env 2>/dev/null
+# Or check .env (IDs only, never the token)
+grep -iE '^VERCEL_(PROJECT|ORG)_ID=' .env 2>/dev/null
 ```
 
 **If you have a project URL** (e.g. `https://vercel.com/my-team/my-project`), extract the team slug:
@@ -314,8 +314,8 @@
 Check the environment and any `.env` files present:
 
 ```bash
-printenv | grep -i vercel
-grep -i vercel .env 2>/dev/null
+printenv | grep -i vercel | cut -d= -f1
+grep -i vercel .env 2>/dev/null | cut -d= -f1
 ```
 
 ### Authentication error