All skills
inference-shell avatar

/agent-browser

@b576e8e

Browser automation for AI agents via inference.sh. Navigate web pages, interact with elements using @e refs, take screenshots, record video. Capabilities: web scraping, form filling, clicking, typing, drag-drop, file upload, JavaScript execution. Use for: web automation, data extraction, testing, agent browsing, research. Triggers: browser, web automation, scrape, navigate, click, fill form, screenshot, browse web, playwright, headless browser, web agent, surf internet, record video

Use this Skill: https://skilld.dev/gh/inference-shell/skills/agent-browser

This session only. Nothing lands on disk.

referencesproxy-support.md

≈1.7k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Proxy Support

Proxy configuration for geo-testing, privacy, and corporate environments.

Related: commands.md for full function reference, SKILL.md for quick start.

Contents

Basic Proxy Configuration

Set proxy when opening a session:

SESSION=$(belt app run agent-browser --function open --session new --input '{
  "url": "https://example.com",
  "proxy_url": "http://proxy.example.com:8080"
}' | jq -r '.session_id')

All traffic for this session routes through the proxy.

Authenticated Proxy

For proxies requiring username/password:

SESSION=$(belt app run agent-browser --function open --session new --input '{
  "url": "https://example.com",
  "proxy_url": "http://proxy.example.com:8080",
  "proxy_username": "myuser",
  "proxy_password": "mypassword"
}' | jq -r '.session_id')

Common Use Cases

Geo-Location Testing

Test how your site appears from different regions:

#!/bin/bash
# Test from multiple regions

PROXIES=(
  "us|http://us-proxy.example.com:8080"
  "eu|http://eu-proxy.example.com:8080"
  "asia|http://asia-proxy.example.com:8080"
)

for entry in "${PROXIES[@]}"; do
  REGION="${entry%%|*}"
  PROXY="${entry##*|}"

  echo "Testing from: $REGION"

  SESSION=$(belt app run agent-browser --function open --session new --input '{
    "url": "https://mysite.com",
    "proxy_url": "'"$PROXY"'"
  }' | jq -r '.session_id')

  # Take screenshot
  belt app run agent-browser --function screenshot --session $SESSION --input '{
    "full_page": true
  }' > "${REGION}-screenshot.json"

  # Get page content
  RESULT=$(belt app run agent-browser --function snapshot --session $SESSION --input '{}')
  echo $RESULT | jq '.elements_text' > "${REGION}-elements.txt"

  belt app run agent-browser --function close --session $SESSION --input '{}'
done

echo "Geo-testing complete"

Rate Limit Avoidance

Rotate proxies for web scraping:

#!/bin/bash
# Rotate through proxy list

PROXIES=(
  "http://proxy1.example.com:8080"
  "http://proxy2.example.com:8080"
  "http://proxy3.example.com:8080"
)

URLS=(
  "https://site.com/page1"
  "https://site.com/page2"
  "https://site.com/page3"
)

for i in "${!URLS[@]}"; do
  # Rotate proxy
  PROXY_INDEX=$((i % ${#PROXIES[@]}))
  PROXY="${PROXIES[$PROXY_INDEX]}"
  URL="${URLS[$i]}"

  echo "Fetching $URL via proxy $((PROXY_INDEX + 1))"

  SESSION=$(belt app run agent-browser --function open --session new --input '{
    "url": "'"$URL"'",
    "proxy_url": "'"$PROXY"'"
  }' | jq -r '.session_id')

  # Extract data
  RESULT=$(belt app run agent-browser --function execute --session $SESSION --input '{
    "code": "document.body.innerText"
  }')
  echo $RESULT | jq -r '.result' > "page-$i.txt"

  belt app run agent-browser --function close --session $SESSION --input '{}'

  # Polite delay
  sleep 1
done

Corporate Network Access

Access sites through corporate proxy:

# Use corporate proxy for external sites
SESSION=$(belt app run agent-browser --function open --session new --input '{
  "url": "https://external-vendor.com",
  "proxy_url": "http://corpproxy.company.com:8080",
  "proxy_username": "'"$CORP_USER"'",
  "proxy_password": "'"$CORP_PASS"'"
}' | jq -r '.session_id')

Privacy and Anonymity

Route through privacy-focused proxy:

SESSION=$(belt app run agent-browser --function open --session new --input '{
  "url": "https://whatismyip.com",
  "proxy_url": "socks5://privacy-proxy.example.com:1080"
}' | jq -r '.session_id')

Proxy Types

HTTP/HTTPS Proxy

{"proxy_url": "http://proxy.example.com:8080"}
{"proxy_url": "https://proxy.example.com:8080"}

SOCKS5 Proxy

{"proxy_url": "socks5://proxy.example.com:1080"}

With Authentication

{
  "proxy_url": "http://proxy.example.com:8080",
  "proxy_username": "user",
  "proxy_password": "pass"
}

Verifying Proxy Connection

Check that traffic routes through proxy:

SESSION=$(belt app run agent-browser --function open --session new --input '{
  "url": "https://httpbin.org/ip",
  "proxy_url": "http://proxy.example.com:8080"
}' | jq -r '.session_id')

# Get the IP shown
RESULT=$(belt app run agent-browser --function execute --session $SESSION --input '{
  "code": "document.body.innerText"
}')
echo "IP via proxy: $(echo $RESULT | jq -r '.result')"

belt app run agent-browser --function close --session $SESSION --input '{}'

The IP should be the proxy's IP, not your real IP.

Troubleshooting

Connection Failed

Error: Failed to open URL: net::ERR_PROXY_CONNECTION_FAILED

Solutions:

  1. Verify proxy URL is correct
  2. Check proxy is running and accessible
  3. Confirm port is correct
  4. Test proxy with curl: curl -x http://proxy:8080 https://example.com

Authentication Failed

Error: 407 Proxy Authentication Required

Solutions:

  1. Verify username/password are correct
  2. Check if proxy requires different auth method
  3. Ensure credentials don't contain special characters that need escaping

SSL Errors

Some proxies perform SSL inspection. If you see certificate errors:

# The browser should handle most SSL proxies automatically
# If issues persist, verify proxy SSL certificate is valid

Slow Performance

Solutions:

  1. Choose proxy closer to target site
  2. Use faster proxy provider
  3. Reduce number of requests per session

Best Practices

1. Use Environment Variables

# Good: Credentials in env vars
'{"proxy_url": "'"$PROXY_URL"'", "proxy_username": "'"$PROXY_USER"'"}'

# Bad: Hardcoded
'{"proxy_url": "http://user:pass@proxy.com:8080"}'

2. Test Proxy Before Automation

# Verify proxy works
curl -x "$PROXY_URL" https://httpbin.org/ip

3. Handle Proxy Failures

# Retry with different proxy on failure
for PROXY in "${PROXIES[@]}"; do
  SESSION=$(belt app run agent-browser --function open --session new --input '{
    "url": "'"$URL"'",
    "proxy_url": "'"$PROXY"'"
  }' 2>&1)

  if echo "$SESSION" | jq -e '.session_id' > /dev/null 2>&1; then
    SESSION_ID=$(echo $SESSION | jq -r '.session_id')
    break
  fi
  echo "Proxy $PROXY failed, trying next..."
done

4. Respect Rate Limits

Even with proxies, be a good citizen:

# Add delays between requests
'{"action": "wait", "wait_ms": 1000}'

5. Log Proxy Usage

For debugging, log which proxy was used:

echo "$(date): Using proxy $PROXY for $URL" >> proxy.log

Source: SKILL.md on GitHub

1 alert13d5 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    The skill provides powerful browser automation capabilities including JavaScript execution and file uploads. While these are intended features, they introduce risks such as indirect prompt injection from malicious websites and the potential for session data exfiltration via scripts.

  • Socket13d

    2 alerts: gptAnomaly, gptSecurity

  • Snyk13d

    Risk: MEDIUM · 1 issue

  • Runlayer6mo

    7/10 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at b576e8e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 5 months ago
What it can do
Runs commands
All 1 allowed tools
Bash(belt *)
  • browser-automation
  • playwright
  • web-scraping
  • form-filling
  • screenshot
  • video-recording
  • javascript-execution
  • inference-sh
  • headless-browser

README badge

README badge for inference-shell/skills/agent-browser

Browser automation using Playwright with inference.sh, controlled via the `belt` CLI. Navigate pages, interact with elements using @e refs, take screenshots, record video, and run JavaScript. Suitable for web scraping, form filling, clicking, typing, drag-drop, file upload, and automated testing workflows.

Generated from the current SKILL.md.

What browser engine does this use?
Playwright. The skill wraps Playwright under the hood with a simplified @e ref system for element interaction.
Do I need to install anything besides the skill?
Yes, you need the belt CLI installed. The skill documentation includes install instructions.
Can I record video of browser sessions?
Yes. Pass record_video: true when opening a session, and the video file is returned when you close the session.
How do I interact with page elements?
Use the @e refs returned by open and snapshot calls. Pass the ref to interact actions like click, fill, drag, upload, or execute JavaScript.
Do element refs stay valid after navigation?
No. Refs are invalidated after navigation, form submission, or dynamic content loading. Always call snapshot after these events to get fresh refs.

Generated from the current SKILL.md. These answers refresh after source changes.