> ## Documentation Index
> Fetch the complete documentation index at: https://docs.befailproof.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# शुरुआत करें

> failproofai इंस्टॉल करें, policies को सक्षम करें, और अपने agents को विश्वसनीयता से चलाएं

## आवश्यकताएं

* **Node.js** >= 20.9.0
* **Bun** >= 1.3.0 (वैकल्पिक - केवल स्रोत से बनाने के लिए आवश्यक)

***

## इंस्टॉलेशन

<CodeGroup>
  ```bash npm theme={null}
  npm install -g failproofai
  ```

  ```bash bun theme={null}
  bun add -g failproofai
  ```
</CodeGroup>

***

## त्वरित शुरुआत

<Steps>
  <Step title="Policies को सक्षम करें">
    Policies नियम हैं जो हर agent tool call से पहले और बाद में चलते हैं। ये विनाशकारी commands, secret leakage, और अन्य failure modes को नुकसान पहुंचने से पहले पकड़ते हैं।

    ```bash theme={null}
    failproofai policies --install
    ```

    यह आपके इंस्टॉल किए गए agent CLIs में hook entries लिखता है (Claude Code के `~/.claude/settings.json`, OpenAI Codex के `~/.codex/hooks.json`, GitHub Copilot CLI के `~/.copilot/hooks/failproofai.json`, Cursor Agent के `~/.cursor/hooks.json`, OpenCode के generated plugin shim में `~/.config/opencode/plugins/failproofai.mjs` plus `~/.config/opencode/opencode.json` के `plugin` array में एक registration entry, Pi के `~/.pi/agent/settings.json`, या Hermes के `~/.hermes/config.yaml`)। जब एक से अधिक मौजूद हों तो आपसे prompt किया जाएगा; prompt को छोड़ने के लिए `--cli claude codex copilot cursor opencode pi hermes` (कोई भी subset) पास करें।

    GitHub Copilot CLI, Cursor Agent, OpenCode, और Pi सपोर्ट **beta** है — `--cli copilot`, `--cli cursor`, `--cli opencode`, या `--cli pi` के साथ इंस्टॉल करें। Hermes (hermes-agent, एक Slack/Telegram gateway) user-scope के साथ `--cli hermes` के साथ इंस्टॉल होता है और **साथ ही** एक offline audit source है।

    ```bash theme={null}
    failproofai policies --install --scope project
    failproofai policies --install --cli codex --scope project
    failproofai policies --install --cli copilot --scope project
    failproofai policies --install --cli cursor --scope project
    failproofai policies --install --cli opencode --scope project
    failproofai policies --install --cli pi --scope project
    failproofai policies --install --cli hermes --scope user
    failproofai policies --install block-sudo block-rm-rf sanitize-api-keys
    ```
  </Step>

  <Step title="सत्यापित करें">
    ```bash theme={null}
    failproofai policies
    ```

    हर policy दिखाता है, चाहे वह सक्षम हो, और कोई भी configured parameters।
  </Step>

  <Step title="Dashboard लॉन्च करें">
    ```bash theme={null}
    failproofai
    ```

    `http://localhost:8020` पर एक local dashboard खोलता है जहां आप sessions को ब्राउज कर सकते हैं, tool calls की जांच कर सकते हैं, और policies को manage कर सकते हैं।
  </Step>

  <Step title="अपने agent को चलाएं">
    Claude Code को सामान्य तरीके से शुरू करें। अगर agent कुछ जोखिम भरा करने की कोशिश करता है, तो failproofai इसे स्वचालित रूप से intercept करता है। इसे unattended चलाएं और dashboard में देखें कि क्या हुआ।
  </Step>
</Steps>

***

## Policies कैसे काम करती हैं

हर बार जब एक agent किसी tool को चलाता है, Claude Code failproofai को एक subprocess के रूप में कॉल करता है:

```text theme={null}
Claude Code  →  failproofai --hook PreToolUse  →  stdin JSON पढ़ता है
                                                 policies का मूल्यांकन करता है
                                                 stdout पर निर्णय लिखता है
```

प्रत्येक policy तीन निर्णयों में से एक देता है:

* **allow** - agent सामान्य रूप से आगे बढ़ता है
* **deny** - कार्रवाई को ब्लॉक किया जाता है, agent को बताया जाता है कि क्यों
* **instruct** - agent के prompt में extra context जोड़ा जाता है

<Note>
  Policies आपकी local process में चलती हैं। कुछ भी remote service को नहीं भेजा जाता है।
</Note>

***

## Convention-based policies के साथ team policies सेट अप करें

अपनी team के across quality standards स्थापित करने का सबसे तेज़ तरीका `.failproofai/policies/` convention है। इस directory में policy files डालें और वे automatically लोड हो जाती हैं — कोई flags नहीं, कोई config changes नहीं, कोई install commands नहीं।

<Steps>
  <Step title="Policies directory बनाएं">
    ```bash theme={null}
    mkdir -p .failproofai/policies
    ```
  </Step>

  <Step title="Policy files जोड़ें">
    Starter examples को कॉपी करें या अपने स्वयं के लिखें:

    ```bash theme={null}
    cp node_modules/failproofai/examples/convention-policies/*.mjs .failproofai/policies/
    ```

    या एक नया बनाएं:

    ```js theme={null}
    // .failproofai/policies/team-policies.mjs
    import { customPolicies, allow, deny, instruct } from "failproofai";

    customPolicies.add({
      name: "test-before-commit",
      match: { events: ["PreToolUse"] },
      fn: async (ctx) => {
        if (ctx.toolName !== "Bash") return allow();
        if (/git\s+commit/.test(ctx.toolInput?.command ?? "")) {
          return instruct("Run tests before committing.");
        }
        return allow();
      },
    });
    ```
  </Step>

  <Step title="Git को commit करें">
    ```bash theme={null}
    git add .failproofai/policies/
    git commit -m "Add team quality policies"
    ```

    हर team member जिसके पास failproofai इंस्टॉल है, ये policies automatically pick up करता है। कोई per-developer setup की आवश्यकता नहीं है।
  </Step>
</Steps>

<Tip>
  अपने repo में `.failproofai/policies/` को commit करें ताकि पूरी team एक ही standards शेयर करे। जैसे-जैसे आपकी team नए failure modes को discover करती है, policies को जोड़ें और push करें — हर कोई अपने अगले `git pull` पर update प्राप्त करता है। समय के साथ ये policies एक living quality standard बन जाती हैं जो बेहतर होती रहती हैं।
</Tip>

***

## डेटा स्टोरेज

सभी configuration और logs आपकी machine पर रहते हैं:

| Path                                      | क्या स्टोर करता है                  |
| ----------------------------------------- | ----------------------------------- |
| `~/.failproofai/policies-config.json`     | Global policy config                |
| `~/.failproofai/hook-activity.jsonl`      | Hook execution history              |
| `~/.failproofai/hook.log`                 | Custom hook errors के लिए debug log |
| `.failproofai/policies-config.json`       | Per-project config (committed)      |
| `.failproofai/policies-config.local.json` | व्यक्तिगत overrides (gitignored)    |

***

## अनइंस्टॉल करना

```bash theme={null}
failproofai policies --uninstall
```

`~/.claude/settings.json` से hook entries को हटाता है। `~/.failproofai/` में config files को रखा जाता है।

***

## अगले कदम

<CardGroup cols={2}>
  <Card title="Configuration" icon="gear" href="/hi/configuration">
    Scopes और config file format
  </Card>

  <Card title="Built-in policies" icon="shield" href="/hi/built-in-policies">
    सभी 26 policies with parameters
  </Card>

  <Card title="Custom policies" icon="code" href="/hi/custom-policies">
    JavaScript में अपनी स्वयं की policies लिखें
  </Card>

  <Card title="Agent monitor" icon="chart-line" href="/hi/dashboard">
    Sessions को monitor करें और policy activity की समीक्षा करें
  </Card>
</CardGroup>
