---
title: "Harbor integration with Langfuse"
sidebarTitle: Harbor
logo: /images/integrations/harbor_icon.png
description: "Send Harbor agent evaluations to Langfuse as experiment runs: each trial's trajectory as a trace, verifier rewards as scores, and runs compared task by task."
category: Integrations
---

# Harbor integration with Langfuse

Use the [Langfuse plugin for Harbor](https://github.com/langfuse/harbor-observability-plugin) to inspect what agents did in [Harbor](https://github.com/harbor-framework/harbor) jobs: each job becomes an experiment run, each trial a trace of the agent's model and tool calls, and each verifier reward a score.

> **What is Harbor?** [Harbor](https://github.com/harbor-framework/harbor) is an open-source framework for evaluating agents in sandboxed environments. A task bundles an instruction, a container environment, and a verifier that grades the result. Harbor runs agents such as Claude Code, Codex, or OpenHands on tasks locally with Docker or in cloud sandboxes, and shares datasets of tasks on the [Harbor Hub](https://hub.harborframework.com).

> **What is Langfuse?** [Langfuse](https://langfuse.com/) is an open-source AI engineering platform. It helps teams trace agentic applications, debug issues, evaluate quality, and monitor costs in production. Use [Langfuse Cloud](/cloud) (hosted by Langfuse, free tier, no infrastructure to run) or [self-host](/self-hosting) it.

**Start with Langfuse** [Sign up](/cloud)

## Get started [#get-started]

<Steps>

### Install the plugin [#install-the-plugin]

Install the plugin into the same environment as Harbor:

```bash
uv tool install harbor --with "harbor-langfuse @ git+https://github.com/langfuse/harbor-observability-plugin"
```

### Set your Langfuse API keys [#set-your-langfuse-api-keys]

Create API keys in your Langfuse project settings:

```bash
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export LANGFUSE_BASE_URL="https://cloud.langfuse.com" # 🇪🇺 EU region
# Other Langfuse data regions include 🇺🇸 US: https://us.cloud.langfuse.com, 🇯🇵 Japan: https://jp.cloud.langfuse.com and ⚕️ HIPAA: https://hipaa.cloud.langfuse.com
```

### Run a job with the plugin [#run-a-job]

Set up the agent's model API key and sandbox as described in the [Harbor README](https://github.com/harbor-framework/harbor), then add `--plugin langfuse` to `harbor run`:

```bash
harbor run -d terminal-bench/terminal-bench-2-1 \
  -a claude-code -m anthropic/claude-sonnet-5-5 \
  --plugin langfuse
```

The plugin sends each trial when it ends. To send a job that already ran, use `harbor-langfuse export jobs/<job-name>`.

### Compare runs [#compare-runs]

Each job appears as one experiment run per agent and model on a dataset named after the Harbor dataset, for example `terminal-bench/terminal-bench-2-1`. Each trial is the run's result for its task: a trace with a generation per model call and a tool observation per tool call, scored with the verifier's rewards, such as `reward`, with the test results as the score's comment. Because the dataset item for a task is the same in every job, you can [compare runs](/docs/evaluation/experiments/compare-experiments) task by task.

  ![Two Harbor runs compared task by task in Langfuse, Claude Code against Terminus-2 on Terminal-Bench 2.1, with each task's reward and the agent's final output](/images/docs/harbor/harbor-compare-runs.webp)

  With several attempts per task (`harbor run -k`), every attempt is part of the run and its scores, but the comparison view shows only the latest attempt per task. Showing every attempt is on the roadmap.

</Steps>

## Test Langfuse-managed skills [#skills]

Install a skill version from [Langfuse Skill Management](/docs/skill-management/overview) with the [Langfuse CLI](/docs/skill-management/get-started#cli-install) and pass its folder to Harbor:

```bash
npm install -g @langfuse/cli
langfuse skills install my-skill --label staging

harbor run -d terminal-bench/terminal-bench-2-1 \
  -a claude-code -m anthropic/claude-sonnet-5-5 \
  --skill .agents/skills/my-skill --job-name my-skill-staging \
  --plugin langfuse
```

The plugin links each trace to the skill versions from the lockfile the CLI writes, so Langfuse shows which skills the agent had and which it [loaded](/docs/skill-management/tracing#availability-and-loads). Run one job per label or version and [compare the runs](#compare-runs).

<!-- agent-instructions -->

---

## Agent Instructions

This page is part of the [Langfuse](https://langfuse.com) documentation, published as plain Markdown for AI agents. Every page is available as Markdown by appending `.md` to its URL, or by sending an `Accept: text/markdown` header. This page: `https://langfuse.com/integrations/other/harbor.md`.

### Querying these docs

If the answer is not on this page, query the documentation instead of guessing:

- **Semantic search** across all Langfuse docs, returning an answer with the relevant pages and excerpts. Ask a specific, self-contained question:

  ```bash
  curl -sG "https://langfuse.com/api/search-docs" --data-urlencode "query=How do I trace a LangGraph agent?"
  ```

- **Index of every page**: <https://langfuse.com/llms.txt>, with per-section indexes [llms-docs.txt](https://langfuse.com/llms-docs.txt), [llms-integrations.txt](https://langfuse.com/llms-integrations.txt), and [llms-self-hosting.txt](https://langfuse.com/llms-self-hosting.txt).

### Before writing Langfuse code

- **Install the [Langfuse Agent Skill](https://langfuse.com/docs/api-and-data-platform/features/agent-skill).** It encodes Langfuse's own best practices for instrumentation, prompt management, and evaluation, and materially improves results.
- **Read [What does a good trace look like?](https://langfuse.com/docs/observability/best-practices.md)** before instrumenting an application.
- **Verify endpoints, parameters, and response fields** against the [OpenAPI spec](https://cloud.langfuse.com/generated/api/openapi.yml), or read the [API reference as Markdown](https://api.reference.langfuse.com/index.md), instead of inferring them from code examples.
- **Use the [Langfuse CLI](https://langfuse.com/docs/api-and-data-platform/features/cli)** (`npx @langfuse/cli api <resource> <action>`) to read or write traces, prompts, datasets, and scores from the terminal.

Found an error in these docs? Please open an issue at <https://github.com/langfuse/langfuse-docs/issues>.
