Don't confuse this with your security model. Adding a
file to your robots.txt file may cause google to ignore parts of your
site, but it won't prevent your server from getting hacked.
This caveat discusses the wisdom of not indicating precisely the files that you don't want users to know about (of course this can be dumb - either way, security through obscurity is an idiot's trick)
<quote>
...since the robots.txt file is accessible to everyone it should not be used to hide specific files or directories on your server.
For example, if you're trying to stop search engines from indexing a file named "list_of_my_passwords.txt" and a folder with sensitive information named "secrets_folder", adding their full names as follows should be avoided whenever possible.
Instead, move your sensitive files and directories into a sub directory and exclude that sub directory by itself. As in the following example, excluding a non-specific directory name such as "folder_a" is a better solution.
If you're unable to reorganize your directory structure, yet have a strong need to exclude certain directories from indexes, use only partial names in the robots.txt file. Although this may not be the best solution, it will at least make it almost impossible to guess full directory names. For example, to exclude "secrets_folder" and "list_of_my_passwords.txt" use following names (given that there aren't any other files or directories in the web root starting with those characters).
</quote>