> For the complete documentation index, see [llms.txt](https://dambio.gitbook.io/dambi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dambio.gitbook.io/dambi/and/data-flows.md). Agents can also search and read this documentation through its [MCP server](https://dambio.gitbook.io/dambi/~gitbook/mcp).

# 데이터 흐름

어떤 데이터가 기기에 남고, 무엇이 언제 서버로 가는지

DAMBI는 **"판정은 기기 안에서, 데이터는 최소한으로"** 를 원칙으로 합니다.

## 기기에만 남는 데이터

| 데이터                | 저장소                                     |
| ------------------ | --------------------------------------- |
| 설치한 정책·정의          | `chrome.storage.local` (`ps2:*`)        |
| 판정 히스토리 (최대 1000건) | `chrome.storage.local` (`verdicts:log`) |
| 설정·인증 토큰           | `chrome.storage.local` (`dambi_jwt` 등)  |
| OpenAI API 키       | 브라우저 `localStorage`                     |

## 서버로 가는 데이터 (`/evaluate` 등)

| 데이터             | 내용                                      |
| --------------- | --------------------------------------- |
| 지갑 식별자          | 주소 + 추적 체인                              |
| **디코드된 행동**     | `ActionBody` (raw calldata가 아니라 해석된 구조) |
| 지갑 상태           | 동기화로 얻은 잔고·승인·포지션                       |
| enrichment 파라미터 | 디코드된 행동에서 추출한 토큰·체인·금액 등                |
| 계정 이메일          | 인증용                                     |

**절대 전송하지 않음**: 🔒 raw calldata 16진수, 개인키·시드 문구, OpenAI 키, 판정·정책 로그(기기 로컬).

## 평가는 기본적으로 오프라인

판정은 기기 안 WASM에서 끝나 네트워크 왕복이 필요 없습니다. 서버는 ① 상태 기반 정책(외부 사실), ② 예측·자산 화면(지갑 동기화), ③ 인증·정책 허브에만 개입합니다. remote fact가 필요할 때도 **해석된 파라미터만**(예: `{ chain, token, amount }`) 보내고 raw calldata는 다시 전송하지 않습니다. → [ActionBody & Cedar](https://dambio.gitbook.io/dambi/undefined-3/actionbody-cedar.md)

## 다음 단계

* 신뢰 모델·서명 → [보안 모델](https://dambio.gitbook.io/dambi/and/security-model.md)
* 제3자 목록·처리방침 → [개인정보 처리방침](https://dambio.gitbook.io/dambi/and/privacy.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://dambio.gitbook.io/dambi/and/data-flows.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
