Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .agents/skills/agentdrive/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: agentdrive
description: Use AgentDrive to read a personal vehicle and send parked commands through the agentdrive program. Use when the user asks about battery, climate, lock state, tyre pressure, a health check, the daily vehicle report, a coarse area, an in-car charging timetable, sentry mode, seat or steering heat, defrost, cabin preconditioning, the rear trunk, the front trunk, remote start, or a parked command such as flash lights, lock, or charging. Do not sign vehicle commands in this skill.
description: Use AgentDrive to read a personal vehicle and send parked commands through the agentdrive program. Use when the user asks about battery, climate, lock state, tyre pressure, a health check, the daily vehicle report, a coarse area, an in-car charging timetable, charging current, a departure time that preconditions the cabin, sentry mode, seat or steering heat, defrost, cabin preconditioning, the rear trunk, the front trunk, remote start, or a parked command such as flash lights, lock, or charging. Do not sign vehicle commands in this skill.
---

# AgentDrive
Expand Down Expand Up @@ -38,22 +38,26 @@ Security trade-off of a shared key: every agent that can read the private key fi

1. `agentdrive doctor`
2. `agentdrive check` — the read-only vehicle status check. It does not wake a sleeping vehicle and it does not send a command.
3. `agentdrive where` — a coarse area only: suburb or locality, state or region, and country. It does not wake a sleeping vehicle, it does not print coordinates, and it does not send a command. A rounded point is sent to Nominatim. Do not copy coordinates into memory.
4. A vehicle command only after doctor and check have finished, and only when the user asks. Park and speed 0 are required. Unlock, turning sentry off, the rear trunk, the front trunk, remote start, and charging changes need a fresh confirmation. A schedule cannot supply that confirmation and cannot run sentry off, the trunk, the front trunk, or remote start.
3. `agentdrive where` — a coarse area: suburb or locality, state or region, and country. It does not wake a sleeping vehicle and it does not send a command. A rounded point is sent to Nominatim. `agentdrive where --precise` prints precise latitude and longitude and a map link when the car is already online. It still does not wake the car. Precise coordinates are not written to the local history. Do not copy them into memory.
4. A vehicle command only after doctor and check have finished, and only when the user asks. Park and speed 0 are required. Unlock, turning sentry off, the rear trunk, the front trunk, remote start, charging changes, and setting or removing a departure schedule need a fresh confirmation. A schedule cannot supply that confirmation and cannot run sentry off, the trunk, the front trunk, remote start, or a departure schedule change.

`agentdrive sentry-on` and `agentdrive sentry-off` change sentry mode. Both wake a sleeping car: if the vehicle list says the car is not online, they send one wake and poll for up to 45 seconds, then send the signed command. `sentry-off` needs a fresh confirmation that names turning sentry off, for example `I confirm turn sentry off`. A schedule cannot supply that confirmation and cannot run `sentry-off`. `agentdrive check`, `agentdrive report`, `agentdrive where`, and history do not wake a sleeping car.

`agentdrive seat-heat`, `agentdrive steering-heat`, `agentdrive defrost-on`, `agentdrive defrost-off`, and `agentdrive precondition` are parked climate commands. They use the same confirmation pattern as climate on, climate off, and set temperature. `seat-heat` takes a seat the signed tool accepts (`front-left`, `front-right`, `2nd-row-left`, `2nd-row-center`, `2nd-row-right`, `3rd-row-left`, `3rd-row-right`) and a level (`off`, `low`, `medium`, or `high`). `steering-heat` is `on` or `off`. Defrost is max defrost, on or off, for the front and rear together. `precondition` starts cabin preconditioning now. It does not add a departure schedule.
`agentdrive seat-heat`, `agentdrive steering-heat`, `agentdrive defrost-on`, `agentdrive defrost-off`, and `agentdrive precondition` are parked climate commands. They use the same confirmation pattern as climate on, climate off, and set temperature. `seat-heat` takes a seat the signed tool accepts (`front-left`, `front-right`, `2nd-row-left`, `2nd-row-center`, `2nd-row-right`, `3rd-row-left`, `3rd-row-right`) and a level (`off`, `low`, `medium`, or `high`). `steering-heat` is `on` or `off`. Defrost is max defrost, on or off, for the front and rear together. `precondition` starts cabin preconditioning now. It does not add a departure schedule. A departure time is `agentdrive departure`.

`agentdrive charge-amps <amps>` sets the charging current. It is a charging command. It needs a fresh confirmation that names the action, for example `I confirm charging set amps`. The value is a whole number from 1 to 80. The car may use less, down to what the charger allows. A scheduled job cannot supply that confirmation and cannot run `charge-amps`.

`agentdrive charge-schedule show` reads the in-car charging timetable and does not wake a sleeping vehicle. `agentdrive charge-schedule set` and `agentdrive charge-schedule remove` change that timetable. They are charging commands. Each one needs a fresh confirmation. A scheduled job cannot supply that confirmation.

`agentdrive departure show` reads the departure schedules and does not wake a sleeping vehicle. `agentdrive departure set` and `agentdrive departure remove` change them. Each change needs a fresh confirmation, for example `I confirm departure schedule set` or `I confirm departure schedule remove`. A scheduled job cannot supply that confirmation and cannot run those two commands. `departure show` is a read. The schedule preconditions the cabin by a time, on selected days, at a place. Latitude and longitude are optional. Omit both and the command uses the car's current location after the same wake other parked changes use. If that location read says the car is asleep, it is not woken again: say the car must be online, or pass coordinates. It does not set a battery switch or an off-peak charging time. `precondition` is still the command that starts the cabin now. Precise coordinates are not written to the local history.

`agentdrive trunk-open` and `agentdrive trunk-close` open and close the rear trunk. Closing works when the vehicle can close the rear trunk. `agentdrive frunk-open` opens the front trunk. The front trunk cannot be closed from AgentDrive. `agentdrive remote-start` enables keyless driving so the car can be driven without the phone key for a short time. It does not drive the car, it does not start an engine, and it does not ask for a password. Each command needs a fresh confirmation that names the action: open rear trunk, close rear trunk, open frunk, or enable remote start. Do not call `tesla-control` for these. The shared core signs them.

`agentdrive status` answers a direct question and may wake a sleeping vehicle. It is still not a lock, unlock, climate, or charging command. Use `agentdrive check` for the check that must happen first.

## Health check

On install, schedule a routine that runs `agentdrive check --json` every 30 minutes. Exit 0 means there is nothing new to report, including when the vehicle is asleep and when the same alerts are still active, so stay quiet. Exit 1 means a new alert the user should hear. Notify only when the exit code is 1. The same alert stays quiet until it clears and later returns. Do not schedule unlock, turning sentry off, the trunk, the front trunk, remote start, or a charging change. `charge-schedule set` and `charge-schedule remove` are charging changes. `sentry-off` is a sensitive command. Do not put `agentdrive report` or `agentdrive history due` on that health-check loop. When the car is already online, `check` also saves local history, including when there is nothing new to notify. It does not wake the car to do that. AgentDrive does not run that job and does not install cron.
On install, schedule a routine that runs `agentdrive check --json` every 30 minutes. Exit 0 means there is nothing new to report, including when the vehicle is asleep and when the same alerts are still active, so stay quiet. Exit 1 means a new alert the user should hear. Notify only when the exit code is 1. The same alert stays quiet until it clears and later returns. Do not schedule unlock, turning sentry off, the trunk, the front trunk, remote start, a charging change, or a departure schedule change. `charge-amps`, `charge-schedule set`, and `charge-schedule remove` are charging changes. `departure set` and `departure remove` are departure schedule changes. `sentry-off` is a sensitive command. Do not put `agentdrive report` or `agentdrive history due` on that health-check loop. When the car is already online, `check` also saves local history, including when there is nothing new to notify. It does not wake the car to do that. AgentDrive does not run that job and does not install cron.

## Morning history

Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/agentdrive/prompts/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The check does not wake a sleeping vehicle.
Exit 0 means there is nothing new to report, including when the vehicle is asleep and when the same alerts are still active.
Exit 1 means a new alert. Notify only when the exit code is 1.
The same alert stays quiet until it clears and later returns.
Do not schedule unlock, turning sentry off, the trunk, the front trunk, remote start, or a charging change on that routine.
Do not schedule unlock, turning sentry off, the trunk, the front trunk, remote start, a charging change, or a departure schedule change on that routine.
Do not put `agentdrive report` or `agentdrive history due` on that health-check loop.
AgentDrive does not run that job and does not install cron.

Expand Down
4 changes: 3 additions & 1 deletion DISCLAIMER.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ Use AgentDrive only on a vehicle you own, or a vehicle you are explicitly allowe

To the maximum extent permitted by law, the software and the documentation are provided as is, without warranty of any kind, and the author's liability is excluded. Nothing in this disclaimer excludes, restricts, or modifies any consumer guarantee, right, or remedy under the Australian Consumer Law that cannot be excluded. Where the Australian Consumer Law allows liability for a failure to comply with a consumer guarantee to be limited, the author's liability is limited to the maximum extent permitted by that law.

A command that changes the vehicle is sent only when the shift state is Park and the speed is zero. After every command, AgentDrive reads the vehicle again and reports that observed state. Unlock, remote start, opening the front trunk, opening or closing the rear trunk, turning sentry mode off, and any charging change each require a fresh explicit confirmation. That confirmation covers that single action and then expires. It is never reused, and a schedule cannot supply it or skip it. A schedule also cannot run remote start, the rear trunk, the front trunk, or turning sentry mode off. Turning sentry mode on, seat heat, steering-wheel heat, defrost, and preconditioning the cabin now are parked commands with that same park and speed check. They do not add a separate confirmation.
A command that changes the vehicle is sent only when the shift state is Park and the speed is zero. After every command, AgentDrive reads the vehicle again and reports that observed state. Unlock, remote start, opening the front trunk, opening or closing the rear trunk, turning sentry mode off, any charging change, and setting or removing a departure schedule each require a fresh explicit confirmation. That confirmation covers that single action and then expires. It is never reused, and a schedule cannot supply it or skip it. A schedule also cannot run remote start, the rear trunk, the front trunk, turning sentry mode off, or a departure schedule change. Turning sentry mode on, seat heat, steering-wheel heat, defrost, and preconditioning the cabin now are parked commands with that same park and speed check. They do not add a separate confirmation.

Follow Tesla's current safety guidance, developer terms, and Fleet API terms. Where those terms and this project differ, the terms win. Obey the road rules that apply where you are, and do not interact with the AI agent while you are driving.

A private key together with an access token can operate the vehicle inside the scopes you approved. Keep both of them private. The author is not responsible if they leak, or if a command is sent in error.

Precise coordinates are used only when you ask for a precise location or a departure place taken from the car. They are not written to the local history.

Reported problems, safety issues, and suspected abuse are reviewed and fixed promptly. Ordinary reports go to GitHub Issues. Security reports go through GitHub private vulnerability reporting, as described in SECURITY.md.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You say what you want. The AI agent runs AgentDrive on your computer. Reads use

Say it in a sentence. The AI agent does the rest.

**Run the parked car from the chat.** Lock or unlock it, turn the climate on or off, set the temperature, heat a seat, heat the steering wheel, turn defrost on or off, or precondition the cabin. Turn sentry mode on or off. Open the rear trunk and close it when the car can, open the front trunk (the frunk), and enable remote start so the car can be driven without the phone key. Start or stop charging, and set a charge limit. Flash the lights or honk. Unlock, turning sentry off, charging, the trunk, the front trunk, and remote start each wait for a confirmation. You can also set the car's own charging timetable, or ask which area the car is parked in.
**Run the parked car from the chat.** Lock or unlock it, turn the climate on or off, set the temperature, heat a seat, heat the steering wheel, turn defrost on or off, or precondition the cabin. Turn sentry mode on or off. Open the rear trunk and close it when the car can, open the front trunk (the frunk), and enable remote start so the car can be driven without the phone key. Start or stop charging, set a charge limit, set the charging current, and schedule cabin warm-up before you leave. Flash the lights or honk. Unlock, turning sentry off, charging, the trunk, the front trunk, and remote start each wait for a confirmation. You can also set the car's own charging timetable, or ask which area the car is parked in.

**Get a health alert when something new needs you.** Tyre pressure, a low battery, a charge problem, or the car left unlocked or open. You hear about it when it is new. The same alert then stays quiet until it clears and comes back.

Expand Down Expand Up @@ -75,7 +75,7 @@ Only ask me for the approvals those instructions say the human must do.

## Disclaimer

Experimental and testing purposes only. AgentDrive is unofficial and is not a Tesla product. Use it only on a vehicle you own, or a vehicle you are explicitly allowed to control. To the maximum extent permitted by law the software is provided as is, and the author's liability is excluded. Nothing here excludes a right under the Australian Consumer Law that cannot be excluded. The full text is in [DISCLAIMER.md](DISCLAIMER.md). Read [SECURITY.md](SECURITY.md) before you install.
Experimental and testing purposes only. AgentDrive is unofficial and is not a Tesla product. Use it only on a vehicle you own, or a vehicle you are explicitly allowed to control. To the maximum extent permitted by law the software is provided as is, and the author's liability is excluded. Nothing here excludes a right under the Australian Consumer Law that cannot be excluded. The full text is in [DISCLAIMER.md](DISCLAIMER.md). Read [SECURITY.md](SECURITY.md) before you install. Precise coordinates are used only when you ask for them, and they are not saved in the local history.

## Supported agents

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Turn on multi-factor authentication for the vehicle account, the code host that

Never commit or paste a private key, client secret, access token, refresh token, authorization code, VIN, license plate, or live location. Each owner generates a new key pair and registers a new application. Whoever holds the private key and a valid token can act on the vehicle within the approved scopes.

`agentdrive where` is the one command that sends a location onward, and only after rounding. It sends latitude and longitude rounded to two decimal places (about 1 km) to OpenStreetMap Nominatim, and it prints a suburb or locality, a state or region, and a country. It does not print or log the precise or the rounded coordinates. The read needs the `vehicle_location` scope. `status` and `check` do not request location.
`agentdrive where` reads location only when the vehicle list already says the car is online. It does not wake the car. The default command sends latitude and longitude rounded to two decimal places (about 1 km) to OpenStreetMap Nominatim and prints a suburb or locality, a state or region, and a country. It does not print that rounded point. `agentdrive where --precise` prints the precise latitude and longitude and an OpenStreetMap link. It does not send that precise point to Nominatim. A departure schedule can use the same precise point when you omit coordinates. Precise coordinates are not written to the local history. The read needs the `vehicle_location` scope. `status` and `check` do not request location.

Local secret files should be readable only by your user. The doctor command checks that the private-key file is present and, on macOS and Linux, not group- or world-readable. On Windows, limit the file ACL to your user. Unix mode bits are not how Windows records that restriction. The token store writes the replacement refresh token with an atomic rename before the previous value is dropped from memory.

Expand All @@ -26,7 +26,7 @@ A private key that is already paired with another agent you trust can be the key

AgentDrive refuses a state-changing command unless the vehicle reports shift state Park and speed 0. It then reads the vehicle again. If that read does not match the command you asked for, the result is a failure, and the command is not sent a second time.

These actions are sensitive: unlock, remote start, opening the front trunk, opening or closing the rear trunk, sentry mode off, and any charging change. Each one needs an explicit confirmation for that action. A previous "yes" does not carry over. A schedule cannot confirm them, cannot skip the check, and cannot run remote start, the rear trunk, the front trunk, or sentry mode off. Turning sentry mode on, seat heat, steering-wheel heat, defrost, and preconditioning the cabin now are parked commands. They are not on this sensitive list.
These actions are sensitive: unlock, remote start, opening the front trunk, opening or closing the rear trunk, sentry mode off, any charging change, and setting or removing a departure schedule. Each one needs an explicit confirmation for that action. A previous "yes" does not carry over. A schedule cannot confirm them, cannot skip the check, and cannot run remote start, the rear trunk, the front trunk, sentry mode off, or a departure schedule change. Turning sentry mode on, seat heat, steering-wheel heat, defrost, and preconditioning the cabin now are parked commands. They are not on this sensitive list.

Remote commands that can unlock a vehicle create a real theft risk if the credentials leak. Do not leave valuables in the vehicle. After an unlock, confirm that the vehicle is locked again. Prefer leaving sentry mode on when the vehicle is parked somewhere unfamiliar.

Expand Down
2 changes: 1 addition & 1 deletion adapters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ def _persist(self) -> None:


def _schedule_command_is_sensitive(command, sensitive: set[str]) -> bool:
# Sensitive spec names, the charge-schedule family, sentry off, and trunk, frunk, and remote start.
# Sensitive spec names, charge-schedule, charge-amps, departure changes, sentry off, and trunk, frunk, and remote start.
# `check` and `history` stay allowed for the health check and the morning report.
return schedule_blocks(command, sensitive)
Loading
Loading