site/docs/red-team/troubleshooting/linking-targets.md
When using custom providers (Python, JavaScript, HTTP), link your local configuration to a cloud target using linkedTargetId. This consolidates findings from multiple eval runs into one dashboard, allowing you to track performance and vulnerabilities over time and view comprehensive reporting.
/redteam/targets12345678-1234-1234-1234-123456789abc)Format the ID as promptfoo://provider/<target-id> and add to your provider config:
Python provider:
providers:
- id: 'file://my_provider.py'
config:
linkedTargetId: 'promptfoo://provider/12345678-1234-1234-1234-123456789abc'
# Your other config...
JavaScript provider:
providers:
- id: 'file://customProvider.js'
config:
linkedTargetId: 'promptfoo://provider/12345678-1234-1234-1234-123456789abc'
# Your other config...
HTTP provider:
providers:
- id: https
config:
url: 'https://api.example.com/endpoint'
method: 'POST'
linkedTargetId: 'promptfoo://provider/12345678-1234-1234-1234-123456789abc'
headers:
'Content-Type': 'application/json'
body:
prompt: '{{prompt}}'
Results will now consolidate under the linked cloud target.
Problem: linkedTargetId doesn't start with promptfoo://provider/
Solution: Ensure format is exactly promptfoo://provider/<UUID>:
# ✅ Correct
linkedTargetId: 'promptfoo://provider/12345678-1234-1234-1234-123456789abc'
# ❌ Wrong - missing prefix
linkedTargetId: '12345678-1234-1234-1234-123456789abc'
# ❌ Wrong - incorrect prefix
linkedTargetId: 'promptfoo://12345678-1234-1234-1234-123456789abc'
Problem: Target doesn't exist in your cloud organization or you lack access
Troubleshooting steps:
Verify you're logged in:
promptfoo auth status
Check the target exists:
/redteam/targets pageVerify organization access:
Warning message: linkedTargetId specified but cloud is not configured
Problem: You're not logged into Promptfoo Cloud
Solution:
promptfoo auth login
linkedTargetId only works when cloud features are enabled.
Q: Can I use linkedTargetId with built-in providers (OpenAI, Anthropic, etc.)?
Yes, linkedTargetId works with any provider type. However, it's most useful for custom providers (Python, JavaScript, HTTP) since they don't have a stable identifier. Built-in providers (like openai:gpt-4) already have consistent IDs, so they're less likely to need manual linking.
Q: What happens if I remove linkedTargetId after using it?
The next eval will create a new target entry. Previous results remain under the linked target.
Q: Can I link to a target from a different organization?
No, targets are organization-scoped. You can only link to targets in your current organization.
Q: Do I need a new linkedTargetId for each eval?
No! Use the same linkedTargetId across all evals. That's the point - it consolidates results under one target.