# AI-सहायित कोडिंग में Deputy: एजेंट जोड़े हर crate को vault और gate करें

*Published: 2026-10-24  •  Tags: Open Source, Remade with Rust, Foundation of Trust  •  Language: hi*

Source: https://mata.network/hi/learn/how-to-use-deputy-with-ai-assisted-coding/  
English: https://mata.network/learn/how-to-use-deputy-with-ai-assisted-coding/

> कोडिंग एजेंट ऐसे crates जोड़ते हैं जिन्हें कोई review नहीं करता। हर session के बाद Deputy चलाएँ: नए lockfile को acquire और scan करें, जो साफ़ है उसे promote करें, और अन्यथा deputy gate से CI build fail होने दें।

**जब कोई AI agent मेरा Cargo.toml संपादित कर रहा हो तो मैं Deputy का उपयोग कैसे करूँ?**

deputy-cli install करें और passphrase सेट करें, फिर हर agent session के बाद repo के विरुद्ध deputy discover, acquire, analyze और scan चलाएँ। किसी भी finding को स्वयं पढ़ें, जो साफ़ है उसे promote करें, और deputy gate को CI में रखें ताकि कोई भी नया crate unpromoted रहते हुए build fail हो। AI-सहायित कोडिंग में Deputy यही है।

एक घरेलू परियोजना में, मान लीजिए परिवार की तस्वीरों को दो घरेलू मशीनों के बीच sync करने वाली एक छोटी Rust service, एक AI coding agent dependencies को उतनी तेज़ी से जोड़ेगा जितनी तेज़ी से कोई उन्हें पढ़ता है। image thumbnails के लिए कहें और तीन crates आ जाते हैं, हर एक अपने transitive tree के साथ। कोई जाँचता नहीं कि उनमें से कोई पिछले हफ़्ते yanked, re-published या flagged हुआ था या नहीं। agent निश्चित रूप से यह याद रखने वाला नहीं है।

[Deputy](/hi/learn/deputy-rust-dependencies-owned-audited/) उस समस्या का वह हिस्सा ठीक करता है जो केवल अनुशासन से नहीं सुधरता। यह आपके `Cargo.lock` के हर crate को आपके स्वामित्व वाले encrypted vault में copy करता है, हर एक को verify और scan करता है, और unpromoted dependencies को fail-closed gate से गुजरने नहीं देता। यह पृष्ठ AI-सहायित कोडिंग में Deputy की दिनचर्या है: इसे कब चलाना है, यह जो कहता है उसका क्या करना है, और agent इसे किन तरीकों से कमज़ोर करता है।

## Agents को reminder की बजाय gate क्यों चाहिए

Language models उसी crate की ओर बढ़ते हैं जो उन्होंने सबसे ज़्यादा देखा है, और वे उन समस्याओं के लिए helpers जोड़ते हैं जिन्हें standard library पहले ही हल करती है। हर addition dependency closure को बिना किसी review pass के बढ़ा देता है। agent से “run cargo audit” कहलवाना तब तक काम करता है जब तक context window यह भूल न जाए।

एक gate नहीं भूलता। [NIST Secure Software Development Framework](https://csrc.nist.gov/projects/ssdf) third-party components को नियंत्रित करने को अपने आप में एक practice मानता है, और [RustSec advisory database](https://rustsec.org/) वह जगह है जहाँ Rust advisories प्रकाशित होती हैं। [FTC ने भी कहा है](https://www.ftc.gov/news-events/news/press-releases/2024/09/ftc-announces-crackdown-deceptive-ai-claims-schemes) कि AI को दोष देना इस बात का बचाव नहीं है कि कोई product अपने users के साथ क्या करता है। Deputy इन्हें ऐसी जाँच में बदल देता है जो चलती है, चाहे किसी को याद हो या नहीं।

दिशा देने वाला आधा हिस्सा skill folder है। [GitHub पर MATA की प्रकाशित Skills](https://github.com/Remade-With-Rust/building-the-new-internet) से Building the New Internet और use-protection-please को परियोजना में रखें, जो [Dev Tools](/products/) पर भी linked हैं, ताकि agent [remadewithrust.com](https://remadewithrust.com/) की house crate list से शुरू करे। [Safe vibe coding](/hi/learn/safe-vibe-coding-mata-skill-folder/) बताता है कि यह prompting से बेहतर क्यों काम करता है।

## दिनचर्या, session दर session

Deputy एक CLI और API है, ऐसी library नहीं जिसे आप import करें। यह agent के बगल में चलता है, आपके code के अंदर नहीं।

### एक बार install करें और key को पहुँच से बाहर रखें

`cargo install deputy-cli` चलाएँ (Rust 1.85 या नया) और `DEPUTY_PASSPHRASE` को अपने shell में export करें, repo की किसी file में नहीं। vault डिफ़ॉल्ट रूप से `~/.deputy` में जाता है या `$DEPUTY_VAULT` में। source [github.com/Remade-With-Rust/deputy](https://github.com/Remade-With-Rust/deputy) पर है। पहले local run के लिए `DEPUTY_NO_MID=1` mID sign-in छोड़ देता है; एक बार सेट हो जाने पर इसे हटा दें ताकि actions का श्रेय रहे।

### हर agent session के बाद pipeline चलाएँ

जब agent ने `Cargo.toml` छुआ हो, repo के विरुद्ध चलाएँ:

```sh
deputy discover ./app
deputy acquire  ./app
deputy analyze  ./app
deputy scan     ./app
```

Acquire हर नए crate को एक बार fetch करता है, lockfile checksum के विरुद्ध जाँचता है और उसे seal करता है। Analyze language mix दिखाता है, जो यह पहचानने का तेज़ तरीका है कि कोई crate चुपचाप C साथ ले आया है। Scan advisory, integrity failure या substitution पर non-zero लौटाता है।

### हाथ से promote करें, CI में gate करें

Findings स्वयं पढ़ें, फिर जो साफ़ है उसके लिए `deputy promote ./app` चलाएँ; हर promotion को hash-chained receipt मिलती है। CI में `deputy gate ./app` जोड़ें। यह non-zero exit करता है जब तक हर dependency promote और receipted न हो, इसलिए agent का देर रात वाला `cargo add` अपने आप किसी release तक नहीं पहुँच सकता। इस gate को हरा रखना ही AI-सहायित कोडिंग में Deputy का पूरा उद्देश्य है।

## agent Deputy के साथ किन जालों में फँसते हैं

अधिकांश विफलताएँ agent के मददगार बनने की कोशिश से आती हैं।

### किसी flag को हटाने के लिए lockfile फिर से generate करना

अगर scan कोई substitution रिपोर्ट करे, तो agent का स्वभाव है कि `Cargo.lock` हटा दे और error जाने तक rebuild करे। इससे सबूत नष्ट हो जाता है। substitution का अर्थ है कि किसी प्रकाशित version के bytes बदल गए, और आपके vault की copy वही है जिसे आपने जाँचा था। कुछ भी फिर से generate करने से पहले रुकें और देखें।

### बिल्कुल नए releases और git URLs के पीछे भागना

Deputy का New Versions view केवल वे releases दिखाता है जो कम से कम सात दिन पुराने हैं, और Send Plans हर GitHub repo में `docs/plans/deputy-upgrades.md` लिखता है, code संपादित नहीं करता। उस गति को बने रहने दें। agent को `Cargo.toml` में git URL चिपकाते हुए देखें ताकि कोई unreleased fix मिल जाए: offline-coverage check इसे gap के रूप में सूचीबद्ध करेगा, क्योंकि git dependencies, अन्य registries और असफल fetches archive नहीं होते।

### agents को API से जोड़ना और हिसाब रखना

Agent workflows के लिए, `deputy serve --port 7878` localhost API expose करता है, जिसमें `POST /folders/upgrade-plans` शामिल है; local development के बाहर mID चालू रखें। किसी release से पहले use-protection-please चलाएँ, और याद रखें कि Deputy उसी की रक्षा करता है जिस पर अन्य pins resolved हुए, SpaceDB, remade_ffmpeg_rs या rusty_alloc सभी के लिए। जब code परिवार के mesh पर जाता है, तो [Disco Party](/disco-party/) और [MATA](/) का home page बताते हैं कि यह कहाँ चलता है।

सहोदर पृष्ठों में [Mercury](/hi/learn/how-to-use-mercury-with-ai-assisted-coding/), [Carmenta](/hi/learn/how-to-use-carmenta-with-ai-assisted-coding/), [Diana](/hi/learn/how-to-use-diana-with-ai-assisted-coding/) और [rusty_xml](/hi/learn/how-to-use-rusty-xml-with-ai-assisted-coding/) शामिल हैं, और [Learn](/hi/learn/) में और भी हैं। Release notes [futureweb.news](https://futureweb.news/) पर आते हैं, और boards के firmware का काम [dldeploy.com](https://dldeploy.com/) पर होता है। इस तरह इस्तेमाल किए जाने पर, AI-सहायित कोडिंग में Deputy का अर्थ है कि agent जितनी तेज़ी से चाहे टाइप कर सकता है और बिना जाँचा हुआ कुछ भी ship नहीं होता।

## FAQ

**जब agent repo में हो तो Deputy passphrase कहाँ रहना चाहिए?**

अपने shell environment या CI secret store में DEPUTY_PASSPHRASE के रूप में, कभी भी ऐसी file में नहीं जिसे agent पढ़ या commit कर सके। यह vault की encryption key का Argon2id source है और Deputy इसे कहीं संग्रहीत नहीं करता, इसलिए इसे खोने पर vault बंद हो जाता है।

**जब deputy scan कोई finding रिपोर्ट करे तो क्या होना चाहिए?**

निर्णय एक मनुष्य लेता है। advisory, integrity failure या substitution पर scan non-zero exit करता है, अर्थात् वही नाम और version लेकिन अलग hash। agent को Cargo.lock फिर से generate करके इसे clear करने न दें; substitution ठीक वह स्थिति है जहाँ पुराने bytes सही थे।

**Deputy वह नवीनतम release क्यों नहीं दिखाता जो agent चाहता है?**

New Versions केवल वे crates.io releases दिखाता है जो कम से कम सात दिन पुराने हैं। यह देरी जानबूझकर है: hijacked releases अक्सर उनके पहले दिनों में पकड़े जाते हैं। अगर agent कल प्रकाशित version पर ज़ोर देता है, तो प्रतीक्षा करें।

**क्या कोई agent सीधे Deputy से बात कर सकता है?**

हाँ, localhost API के माध्यम से। deputy serve --port 7878 इसे UI और agents के लिए expose करता है, जिसमें POST /folders/upgrade-plans शामिल है। mID authentication डिफ़ॉल्ट रूप से चालू है; --no-mid केवल local development के लिए है।

**Deputy किन dependencies की रक्षा नहीं कर सकता?**

इसका offline-coverage check उन्हें रिपोर्ट करता है: git dependencies, crates.io के अतिरिक्त registries से crates, और असफल fetches। Agents अक्सर unreleased fix पाने के लिए Cargo.toml में git URL चिपका देते हैं, इसलिए हर session के बाद वह report देखें।
